Originally Posted by
iMalc
In th COM case, the functions that deal with the Refcounting are part of the class itself (intrusive), not part of the smart pointer class. Whether you use CComPtr<IUnknown> or IUnknownPtr, or some other home made smart pointer, they all have to go through to calls to Release on the IUnknown interface itself.
You're probably thinking of boost's shared_ptr with its non-intrusive refcounting.
Now that in itself doesn't automatically mean that a home grown start pointer class is instantly perfect, for example it is easy to get the assignment operator wrong. But it does still mean that the destructor will only ever get called once, purely because it is COM that is responsible for this and not the smart pointer itself, which is only responsible for calling AddRef and Release at the right time etc.
People should have no need to use homegrown smartpointers with COM anyway.