c++/cli Best practice for free GCHandle in the finalizer
问题 I have some functions in c and I would use this in a .net application. For this I wrote an Wrapper class with C++/cli. In the c interface is a callback function and wrapped this in a .net delegate. But how should I release the unmanaged ressources for the callback gcHandle? Is it allowd to call IsAllocated and Free from a GCHandle in the finalizer? Because it is an managed ressource and is it possibile that the gc already release it? Here is the code for the c interface: // C functions #ifdef