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.
I realize I am a newcomer to the list, and I do not wish to step on any toes,
so please consider the following discussion in the spirit in which it is
offered, as constructive discourse. In my professional capacity, I have in
the past implemented a large, complex system of classes that used smart-pointer
management of reference-counted objects and as a result I have learned some
things from practical experience.