GNOME Bugzilla – Bug 152397
Crash when showing the "No windows open" message
Last modified: 2004-12-22 21:47:04 UTC
If you don't have any windows open, then using the "Window Selector" applet, you get a "No Windows Open" message, however when you next show the menu, it will either crash, or print nasty warnings:
+ Trace 50065
The g_object_unref() is not needed, as the "no_windows_item" has been removed from the menu already, and no more references are held, so it will have already been destroyed. Patch coming up.
Created attachment 31493 [details] [review] Patch This removes all the references to g_object_unref (window_menu->no_windows_item); The WindowMenu object doesn't hold an explict reference, so it shouldn't be unref()'ing it. It also stops the "Destroy" signal from being attached multiple times to the menu.
I cannot find a duplicate - marking as new.
Thanks for your bug report. Mark?
Crispin: Thanks a lot for the patch. Have checked in a slightly modified version. 2004-10-22 Arvind Samptur <arvind.samptur@wipro.com> Re-worked patch based from Crispin Flowerday <gnome@flowerday.cx> * window-menu.c: (window_menu_destroy_menu): Cleanup no_windows_item element. (window_menu_popup_menu): Attach destory single once. Fixes #1527397
I think you have missed the point of the patch, you must not unref() the "no_windows_item" widget, the object itself is destroyed when the menu is destroyed, so that when you come to unref() the widget, it has already been deleted, and the panel crashes.
crispin: doh! i indeed missed the point. The gtk_container_remove would have already removed the no_windows_item and we are just left with a dangling pointer. Feel free to check in to head
reopening till we get it checked in.
I have checked in the original patch, obviously minus the bits that were already in: http://lists.gnome.org/archives/cvs-commits-list/2004-October/msg04891.html