Re: [gtkmm] Glib::RefPtr construction



On Tue, 2003-01-07 at 22:08, Michael Johnson wrote:
> In reading through the source for Glib::RefPtr I note that the constructor
> 
>     RefPtr<T_CppObject>::RefPtr(T_CppObject* pCppObject)
> 
> Does not increase the reference count of the referenced object, though 
> all other means of assigning a value to a RefPtr (including the 
> assignment operator that takes a pointer) do increase the reference 
> count. Is this intentional, or is it an accidental omission?

The pCppObject is normally created with a refcount of 1, and the final
RefPtr<> destructor unrefs it to 0, causing pCppObject to be deleted.

-- 
Murray Cumming
murray usa net
www.murrayc.com




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