I am learning about COM and reading about this code:
STDMETHODIMP_ (ULONG) ComCar::Release()
{
if(--m_refCount==0) delete this;
return m_refCount;
}
My question is, if the m_refCount==0 and the object is deleted, how could the instance member variable *m_refCount* still exist and be returned? Please forgive me if my question is so naive cause I am a totally newbie on COM. Many thanks.
A related thread is here: http://stackoverflow.com/questions/2309276/how-could-a-member-method-delete-the-object