Class getting destructed through Interop  
Author Message
silent tone





PostPosted: Common Language Runtime, Class getting destructed through Interop Top

I have a .net 2.0 assembly that is exposed through a COM callable wrapper (CCW). The destructor of my managed class is getting called prematurely. The library making COM calls is almost certainly not CoUninitialize-ing the instance, so I don't know where this is coming from. Is there a way to see the origin of such a call (nothing on the vs2k5 de****'s callstack) The time that this happens is pretty predictable, resources aren't low or anything. I can't even find much reading material on this subject. Anything relevant would be appreciated.

Tony



.NET Development13  
 
 
silent tone





PostPosted: Common Language Runtime, Class getting destructed through Interop Top

I may have found the problem. The native library making COM calls was not altering the reference count with AddRef/Release. In my defense, I've never used COM before and this bit was written by a consultant.

I still don't know why this was only a problem when more than one instance of my managed class was created.

Tony