I have three unmanaged dll functions:
void Init(){}
void Run(){}
void Done(){}
They work with the same managed object. Init() function inits the object, Run() uses it and Done() clears it.
My main question is: Is it necessary to use GCHandle.Alloc(managedObject, GCHandleType.Pinned) for such object (to pin it)?