Re: The use of RefPtr
- From: Chris Vine <chris cvine freeserve co uk>
- To: Murray Cumming <murrayc murrayc com>
- Cc: Hubert Figuiere <hub figuiere net>, gtkmm-list gnome org
- Subject: Re: The use of RefPtr
- Date: Sun, 8 Mar 2009 17:33:21 +0000
On Sun, 08 Mar 2009 11:57:10 +0100
Murray Cumming <murrayc murrayc com> wrote:
> On Sun, 2009-03-08 at 00:55 +0000, Chris Vine wrote:
> > That does not explain why Glib::Object and Gtk::Object are treated
> > differently - it does not seem to me that
> > Glib::ObjectBase/Glib::Object
> > needed to be implemented this way, but they were. It may possibly
> > be a
> > hangover from glib-1 and gtk+-1.
>
> I don't understand what you are asking, but GObject and GtkObject have
> different memory management, as you say, so we handle them
> differently. The Gtk::Object::destroy_notify_() method override
> handles the concept of "managed", which does not exist for
> Glib::Objectbase::destroy_notify(). There's similar cleverness to deal
> with that elsewhere too.
In glib-2/gtk+-2 a lot of the code formerly in GtkObject was moved to
GObject. There is no significant difference in memory management
between a pure GObject and a GtkObject, other than the floating
reference, which amounts to very little (it is a device to make it
easier for containers to take ownership). They could both be wrapped
identically in gtkmm, as they are in other bindings such as PyGTK and
java-gtk+. They have not been, and that's fine.
Chris.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]