John C wrote:
But IUnknown.Release does no such thing. If you're talking about the implementation in std.c.windows.com.ComObject, then all it does is decrement the reference count. It has a comment saying "let the GC reap it" - which is incorrect, since the GC doesn't collect COM objects (as you say above). So anyone deriving from ComObject is leaking memory.
There does appear to be a bug there, because the allocator allocates it with malloc().
