After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676702 - 0.13.3: crash on exit due to get_selected() being called on a null treeview selection
0.13.3: crash on exit due to get_selected() being called on a null treeview s...
Status: RESOLVED FIXED
Product: alacarte
Classification: Applications
Component: general
0.13.x
Other Linux
: Normal normal
: ---
Assigned To: Alacarte Maintainer(s)
Alacarte Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-05-24 04:53 UTC by Alexandre Rostovtsev
Modified: 2012-05-24 20:49 UTC
See Also:
GNOME target: ---
GNOME version: 3.3/3.4


Attachments
proposed patch (1.47 KB, patch)
2012-05-24 04:56 UTC, Alexandre Rostovtsev
committed Details | Review

Description Alexandre Rostovtsev 2012-05-24 04:53:54 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):
  • File "/usr/lib64/python2.7/site-packages/Alacarte/MainWindow.py", line 370 in on_menu_tree_cursor_changed
    menus, 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'
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.
Comment 1 Alexandre Rostovtsev 2012-05-24 04:56:17 UTC
Created attachment 214838 [details] [review]
proposed patch