Re: [gtkmm] "manage" and Glib::RefPtr



Am 2002.10.10 18:52 schrieb(en) Daniel Elstner:
Am Don, 2002-10-10 um 18.33 schrieb Martin Schulze:
> This is only a technical note about the current gtkmm2 code to avoid
> misunderstandings:
> Using Glib::RefPtr<Foo>(new Foo()) doesn't work if Foo inherits
> Gtk::Object: The c++ wrapper Foo will never be deleted because the
> line "delete this" in Gtk::Object::destroy_notify_() is not executed
> unless "referenced_" is false, i.e. unless the object is manage()ed.

Yeah but that's easy to get around.  I actually did it in a private
gtkmm tree to test the idea out.

Of course, but it is important that people know that this change is
incompatible with the existing memory management models because it
forbids to hold widgets on the stack using the current syntax.

Regards,

  Martin



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