Re: refptr and this



On Fri, 2008-02-15 at 23:36 -0600, Jonathon Jongsma wrote:
>  child->set_parent(Glib::RefPtr<Item>(this));
> Except this seems to cause refcounting problems and the program crashes.

The RefPtr constructor does not take a reference, so you need to do
RefPtr<Item>(this, true). I think it's that simple.

Murray.



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