GNOME Bugzilla – Bug 93703
Gtk-CRITICAL on Dialog destruction
Last modified: 2004-12-22 21:47:04 UTC
When you close the dialog in the following example i get an error message in the console: [sumpan@e dialog_entry_test]$ ./dialog_entry_test (dialog_entry_test:17708): Gtk-CRITICAL **: file gtkcontainer.c: line 878 (gtk_container_remove): assertion `GTK_IS_CONTAINER (container)' failed Is there a problem placing a Gtk::Box inside another Gtk::Box? If you change the entry to a pointer and use manage to initialize it everything works as expected.... --- #include <gtkmm.h> using namespace SigC; class TestDialog : public Gtk::Dialog { public: TestDialog() : Gtk::Dialog("Test-dialog", true, true) { get_vbox()->pack_start(vbox); vbox.pack_start(e); show_all(); } private: Gtk::Entry e; Gtk::VBox vbox; }; int main (int argc, char *argv[]) { Gtk::Main kit(argc, argv); TestDialog d; kit.run(d); return 0; }
Confirmed. I added this code to gtkmm/tests/dialog/.
I think I fixed this. Please check cvs (when anoncvs syncs) and reopen if it's still a problem: 2002-09-20 Murray Cumming <murrayc@usa.net> * gtk/src/object.ccg: Container_Class::destroy_callback(): Added a g_object_ref before the gtk_container_remove for un-manage()ed child widgets, so that they are not destroyed before their C++ destructors destroy them with gtk_object_destroy().