3 ms·
The problem is even worse than it looks on the surface (from the client side). If you're implementing a library that holds native resources in .NET it's better
by hdhzy 10y ago
The problem is even worse than it looks on the surface (from the client side). If you're implementing a library that holds native resources in .NET it's better to familiarize yourself with CriticalFinalizerObject [0], SafeHandles and Constrained Execution Regions. Writing correct finalizers that work even when out of memory exceptions are thrown is no easy task...
[0]: https://msdn.microsoft.com/en-us/library/system.runtime.constrainedexecution.criticalfinalizerobject(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/system.runtime.cons...