The CLR marshaler encountered an error while attempting to release the reference to a SafeHandle it acquired in order to ...

The CLR marshaler encountered an error while attempting to release the reference to a SafeHandle it acquired in order to marshal the SafeHandle to an unmanaged pointer during a call from managed to unmanaged. This may cause the unmanaged resource the SafeHandle represents to be leaked. The cause of the failure was: %1$s