GNOME Bugzilla – Bug 496054
crash when using a single workspace
Last modified: 2007-12-09 23:12:31 UTC
When the number of workspaces is 1, bringing up the window menu leads to a crash in meta_window_menu_new, when attaching an item for MENU_ITEM_WORKSPACE_LIST
Created attachment 98955 [details] [review] the patch
Can you confirm this is a problem in trunk, please? I can't reproduce it.
(Patch is good if the problem exists, but I can't reproduce it.)
i've only see this actually cause crashes when running the new gdm's login screen under metacity, inside a full session I have only seen g_criticals due to this. But it is clear from the code that you can reach that place in the function with mi being NULL.
I'm sorry if I'm being slow, but I don't see how it's clear that mi can be NULL at that point. mi is initialised to the result of menu_item_new (). This can only be NULL if menuitem->type is MENU_ITEM_WORKSPACE_LIST, whereupon mi is reassigned to the result of menu_item_new () given a MENU_ITEM_NORMAL! So how can mi be NULL at the end of the function? Nevertheless, I can't see it can do much harm to program defensively and check whether mi is null if we're going to pass it places.
okay, committed.