c++ - Does Release call on an Interface ensure that the COM Component is distroyed -
i working on issue see intermittent crashes happening @ customer site, while code review, found have written code in destructor free memory etc. question when destruct-or gets called.
does called when client call's release on interface. or how free resources consumed interface or when supposed free resources.
i know when call relase returns "0" com calls dllcangetunloadnow , dll unloaded , freeing memory?
can clarify
regards tom
typically implementing object's destructor called release
if reference count has reached zero. performed implementing object's implementation of release
.
so, typical implementation of release
looks this:
ifacemethodimp_(ulong) release() { ulong cref = interlockeddecrement(&_cref); if (!cref) delete this; return cref; }
Comments
Post a Comment