GNOME Bugzilla – Bug 760030
Crash in TreeView::get_tooltip_context_path
Last modified: 2016-01-01 19:19:58 UTC
Created attachment 318080 [details] A simple, ugly test demonstrating the bug TreeView::get_tooltip_context_path causes a crash due to a double delete if gtk_tree_view_get_tooltip_context returns false(i.e. when hovering over the TreeView, but not over a row). This is the same issue that was fixed in IconView a while ago: https://git.gnome.org/browse/gtkmm/commit/gtk/src/iconview.ccg?id=fdbdce42f4a4405e9709f5a206c9df96c2adb6e4 A simplistic, minimal, ugly, quickly hacked together testcase is attached. It just creates a TreeView with a TreeStore showing a few numbers, sets has_tooltip and connects to signal_query_tooltip. The callback only calls get_tooltip_context_path and returns false, which causes the aforementioned crash. Replacing it with a call to get_tooltip_context_iter and constructing a path does not cause problems. I compiled the testcase with the following command: g++ test_tree_view_get_tooltip_context_path.cpp -o test `pkg-config gtkmm-3.0 --cflags --libs` -std=c++11 -Wall -pedantic -Werror on Arch Linux with gtkmm3 3.18.0-2.
Created attachment 318103 [details] [review] patch
Thanks. I've pushed your patch. Your test case is good enough. The only thing that's not perfect is that you did not create the patch with git add gtk/src/treeview.ccg git commit git format-patch origin or a similar sequence of git commands.
Thanks ;-) I simply followed the directions found here: http://www.gtkmm.org/en/bugs.html#NewBugs and therefore used the command git diff -u > my_fix.patch If this is not the prefered way, maybe the page could/should be updated?
It's true, like is said in www.gtkmm.org, that git diff is the simplest way to create a patch, if you are unfamiliar with Git. We could perhaps add an alternative for those who want to make an even better patch. www.gtkmm.org is not updated as often as it should be. It contains several obsolete details. For example it's said that you should edit ChangeLog when you create a patch. That's not true any more.