Re: The use of RefPtr



On Sat, 7 Mar 2009 21:52:07 +0000
Chris Vine <chris cvine freeserve co uk> wrote:
> That does not seem to me to be a win.  But if your question is, can
> you do it, then as someone on your side of the Atlantic might say, yes
> you can.

I should also have mentioned for completeness that if you want to go
down this route you will also need to overide the virtual method
Glib::ObjectBase::delete_notify_() (which calls 'delete this') and in
the destructor of your derived object set the underlying GObject
pointer to 0 to neutralise Glib::ObjectBase::~ObjectBase(). This makes
you hostage to other changes of internals that you really shouldn't be
thinking about.  In short, you will need to do what Gtk::Object does.

It is better not to try.

Chris


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