After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 93703 - Gtk-CRITICAL on Dialog destruction
Gtk-CRITICAL on Dialog destruction
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.0
Other Linux
: Normal minor
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2002-09-19 21:08 UTC by Daniel
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel 2002-09-19 21:08:06 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;
}
Comment 1 Murray Cumming 2002-09-20 08:21:05 UTC
Confirmed. I added this code to gtkmm/tests/dialog/.
Comment 2 Murray Cumming 2002-09-20 10:26:32 UTC
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().