Re: The recommended way to destroy a Gtk::Dialog on response?



On Wed, 2007-06-06 at 12:40 -0500, Paul Davis wrote:
> You can also put the object into a smart pointer. I'd recommend
> boost's shared_ptr.

just be very carefeul with shared_ptr and sigc slots. if you ever do
this:

 	bind (mem_fun (someObject, &SomeObject::method), aSharedPtrToFoo);

then the created slot holds a reference to Foo that may be hard to get
rid of. if you program sets up objects and only destroys them at
shutdown, if at all, this is not an issue. but if you need careful
management over object lifetimes, this can be a very nasty combination
of two very nice programming idioms.

--p






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