GNOME Bugzilla – Bug 676702
0.13.3: crash on exit due to get_selected() being called on a null treeview selection
Last modified: 2012-05-24 20:49:26 UTC
I am occasionally getting crashes when closing alacarte-0.13.3 due to get_selected() being called on a null treeview selection in a cursor-changed callback. It happens once in a while during normal use. I also found a somewhat contrived but 100% reliable way of reproducing the crash: (1) ensuring that the window manager is in sloppy focus mode; (2) selecting an item in alacarte, and opening the Properties dialog; (4) moving the mouse cursor first to the dialog and then to the main alacarte window, so that the main window gets input focus; (5) pressing Esc. The traceback in this case is as follows: Traceback (most recent call last):
+ Trace 230263
menus, iter = treeview.get_selection().get_selected()
Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/Alacarte/MainWindow.py", line 428, in on_item_tree_cursor_changed items, iter = treeview.get_selection().get_selected() AttributeError: 'NoneType' object has no attribute 'get_selected' Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/Alacarte/MainWindow.py", line 428, in on_item_tree_cursor_changed items, iter = treeview.get_selection().get_selected() AttributeError: 'NoneType' object has no attribute 'get_selected' So it appears that we need to check for a null selection in these callbacks.
Created attachment 214838 [details] [review] proposed patch