I've loaded CoreClr from hostFxr and it looks like the garbage Collector is not doing his job...
I'm trying to build a safe interop with Rust and C#, And I wanted SafeHandle to manage native rust object in C#, but DestroyHandle() is never called (while all references to this object are out of scope). so I tried to make a basic objet with a finalizer (inheriting CriticalFinalizerObject) and this finalizer is never called too...
My entry point is an unmanagedMethod, and CoreClr is loaded with the netCoreHost rust crate.
4 Replies
look managed unmanaged method never call the GC, I a third method (i've a setup a DLLresolver to my host executable, the main function) and now I added a thrid function which call the GC by and finalizer are called now
interessting, here my C# side (shorted)
so the execepted output should look like that:
but it actually looks like that
ok the third parameter of collect handle that
GC.Collect(3, GCCollectionMode.Default, true);
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View