Custom container issue - gtkmm mingw


I made a custom container (sort of a modified notebook widget) following the gtkmm tutorial, overriding all the functions mentioned in there. The control has tabs (which are internal children) and pages (added by the top-level window).

There is no ambiguity in the on_size_request, on_size_allocate, on_expose_event or the child_type_vfunc overrides. on_add and on_remove also seems to go well. However while closing the application the debug console is full of the following messages.

(Commander.exe:7480): GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `GtkContainer'

(Commander.exe:7480): Gtk-CRITICAL **: gtk_container_remove: assertion `GTK_IS_CONTAINER (container)' failed

(Commander.exe:7480): GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `GtkContainer'

(Commander.exe:7480): Gtk-CRITICAL **: gtk_container_remove: assertion `GTK_IS_CONTAINER (container)' failed


And not just 4 lines: One for each widget that is a child or grand child of my custom container. To test, I removed the custom container and added one of the pages (that contained most number of child widgets) directly to the top level window (this page also happens to be a custom control derived from Gtk::VBox). Nothing crashed this time.

On debugging the app what I noticed is while closing gdb detects segmentation fault in the for_all_vfunc override of the custom container and stalls. The callstack says this
Thread [1] (Suspended: Signal 'SIGSEGV' received. Description: Segmentation fault.)   
    16 gtk_widget_propagate_hierarchy_changed_recurse()  0x61990115   
    15 MM::CMMNotebook::forall_vfunc() D:\****\Projects\Custom Controls\UI\MMNotebook.cpp:1059 0x004157b6   
    14 Gtk::Container_Class::forall_vfunc_callback() D:\Software\Linux\Source\gtkmm-2.14.3\gtk\gtkmm\ 0x00f42ba1   
    13 gtk_container_forall()  0x617d7a30   
    12 gtk_widget_propagate_hierarchy_changed_recurse()  0x61990251   
    11 gtk_box_forall()  0x6179fcfb   
    10 Gtk::Container_Class::forall_vfunc_callback() D:\Software\Linux\Source\gtkmm-2.14.3\gtk\gtkmm\ 0x00f42c11   
    9 gtk_container_forall()  0x617d7a30   
    8 gtk_widget_propagate_hierarchy_changed_recurse()  0x61990251   
    7 _gtk_widget_propagate_hierarchy_changed()  0x619909da   
    6 gtk_widget_unparent()  0x61990c5a   
    5 gtk_bin_remove()  0x6179b36c   
    4 Gtk::Container_Class::remove_callback() D:\Software\Linux\Source\gtkmm-2.14.3\gtk\gtkmm\ 0x00f4232e   
    3 g_closure_invoke()  0x63a43955   
    2 signal_emit_unlocked_R()  0x63a578a2   
    1 <symbol is not available> 0x00000000

The segmentation fault always happens at this particular line where the callback is called for this particular widget. But like all other pages added to this custom container, this widget is also a member of the top-level window and is not deleted and for that matter does not go out of scope.

what am I missing?

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]