On Sun, 18 Dec 2005 03:43:17 -0600, Paul Davis
<[EMAIL PROTECTED]> wrote:
Murray Cumming wrote:
On Fri, 2005-12-16 at 22:38 +0100, Marco wrote:
http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/classGlib_1_1RefPtr.html
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch18s02.html
RefPtr is not meant to be a general-purpose smartpointer. I don't
recommend using it with Widgets.
Unless I've completely misunderstood the entire memory managemeny scheme
used by Gtk, once you call Gtk::manage(), you release all control of
memory management to the library. In other words, explicitly calling a
widget's destructor ( or implicitly via smart pointer reference counting
) would be 'bad'. I say 'bad' cause I'm not really sure what you'd run
into. I imagine you'd start getting things like memory corruption
errors or those fun messages about freeing the same memory segment
multiple times. Anyway, thats just how I had understood things.
Paul
manage() makes the container responsible for deleting the widget so it
would not be usefull in a case where you temporarily want to remove the
widget from its container.
That is a case where you have to delete manually or use a smartpointer.
--
Marco
_______________________________________________
gtkmm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtkmm-list