Re: [[gtkmm] technical question: GTKMM_LIFECYCLE]
- From: Murray Cumming <murrayc usa net>
- To: "Martin Schulze" <MHL Schulze t-online de>, gtkmm-list <gtkmm-list gnome org>
- Cc: Christian Meyer <chrisime gnome org>
- Subject: Re: [[gtkmm] technical question: GTKMM_LIFECYCLE]
- Date: Fri, 27 Sep 2002 19:10:27 +0100
MHL Schulze t-online de (Martin Schulze) wrote:
> In the process of wrapping gstreamer a few questions regarding
> the lifecylce management code of gtkmm popped up.
> In the current implementation of Gtk::Object the following behaviour
> doesn't seem to be 100% consistent (first scenario):
> - Why do we force a gtk_object_destroy() in the c++ instance's dtor
> when it hasn't been manage()ed (i.e. referenced_ == true)?
> Why don't we ensure that we simply remove all the references that
> have been created from our c++ wrappers instead?
Because the C instance should be destroyed when the C++ instance is deleted.
Why would you want a more complicated memory model?
> - gtkmm objects that were not manage()ed are reference counted non
> the less. However, when the reference counter reaches zero the
> c object is deleted but the c++ instance is not (only gobject_ is
> set to 0).
No, whenever a C object is destroyed, the C++ instance _will_ be deleted. It
might not be obvious how that happens, though I have tried to add verbose and
repetitive comments about that kind of thing.
I'll ignore the rest of your comments because they seem to depend on that
murrayc usa net
] [Thread Prev