GNOME Bugzilla – Bug 725146
Criticals from menu code
Last modified: 2017-10-09 11:34:53 UTC
Created attachment 270273 [details] Test program With the upcoming test program, selecting Moo->Baa produces... (a.out:9711): Gtk-CRITICAL **: gtk_window_set_attached_to: assertion `GTK_IS_WINDOW (window)' failed Similar code to this further produces ref-count errors on my home machine which has a newer gtk+. I will test this particular piece of code on that machine later. The problem only occurs for menu entries in a submenu. When "Baa" is moved to the top-level menu I see no problem.
Created attachment 270278 [details] [review] Proposed patch There are other uses of this pointer without testing that might fire a critical.
What are you trying to achieve ? Is the intention really to destroy the submenu ?
> Is the intention really to destroy the submenu? Yes. It's a single-use context menu.
but presumably you want to destroy the entire menu, not just the submenu that happens to contain the activated item ?
Sorry, I misread your question in comment 2. The intention is to get rid of the entire menu.
the callback doesn't do that, though. The toplevel it finds is the submenu - each menu is its own toplevel. Admittedly, the menu could should probably be safe against this sort of thing, by detaching on destroy.
*** This bug has been marked as a duplicate of bug 788163 ***