MenuButton not notified when its Popover is destroyed, still accesses it in dispose()
- Have a
MenuButton
and aPopover
, set up viamenuButton.set_popover(popover)
- Use a binding like
gtkmm
and declare such thatpopover
is destroyed beforemenuButton
-
menuButton
is not notified thatpopover
is dead, sodispose()
accesses an invalid instance
We presumably want the destruction of the Popover
to clear the reference in the MenuButton
.
Thread 1 "concentration" received signal SIGSEGV, Segmentation fault.
0x00007ffff617eaf7 in gtk_popover_set_relative_to (popover=0x5555558c2470, relative_to=0x0)
at /home/daniel/jhbuild/checkout/gnome/gtk+-3/gtk/gtkpopover.c:2205
2205 g_return_if_fail (GTK_IS_POPOVER (popover));
(ins)(gdb) bt
#0 0x00007ffff617eaf7 in gtk_popover_set_relative_to (popover=0x5555558c2470, relative_to=0x0)
at /home/daniel/jhbuild/checkout/gnome/gtk+-3/gtk/gtkpopover.c:2205
#1 0x00007ffff611b678 in gtk_menu_button_dispose (object=0x555555bbe240)
at /home/daniel/jhbuild/checkout/gnome/gtk+-3/gtk/gtkmenubutton.c:1042
#2 0x00007ffff79d4bcd in Gtk::Widget_Class::dispose_vfunc_callback (self=0x555555bbe240)
at /home/daniel/jhbuild/checkout/gnome/gtkmm-3/gtk/gtkmm/widget.cc:678
#3 0x00007ffff55f1047 in g_object_run_dispose (object=0x555555bbe240)
at /home/daniel/jhbuild/checkout/gnome/glib/gobject/gobject.c:1108
#4 0x00007ffff7a24707 in Gtk::Object::_release_c_instance (this=0x555555838fa8)
at /home/daniel/jhbuild/checkout/gnome/gtkmm-3/gtk/gtkmm/object.cc:131
#5 0x00007ffff7a24c01 in Gtk::Object::destroy_ (this=0x555555838fa8)
at /home/daniel/jhbuild/checkout/gnome/gtkmm-3/gtk/gtkmm/object.cc:266
#6 0x00007ffff793b86b in Gtk::MenuButton::~MenuButton (this=0x555555838fa8, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
at /home/daniel/jhbuild/checkout/gnome/gtkmm-3/gtk/gtkmm/menubutton.cc:156
I didn't check in depth but don't think this is a problem when the popup is a Menu
instead, as I use that elsewhere and never encountered this crash.
Edited by Daniel Boles