Hello everyone,


Suppose I have a component (class) CX implements IUnknown interface, and I have retrieved a pointer of CX by IUnknown pointer (IUnknown*), that is.

Code:
IUnknown* pCX;
QueryInterface (IID_IUnknown, &pCX);

//...

delete pCX; // memory and resource leak here?
Even if I declare the component CX's destructor as virtual, if I delete through IUnknown pointer to "release" the object, there is still potential memory and resource leak, because in IUnknown interface, destructor is the compiler provided default one, which is non-virtual and public, right?


thanks in advance,
George