public static void FreeNativeMapping (INativeEventObjectWrapper wrapper)
{
EventObjectToggleRef tref;
IntPtr native = wrapper.NativeHandle;
if (native == IntPtr.Zero)
return;
lock (objects) {
if (objects.TryGetValue (native, out tref))
objects.Remove (native);
}
if (tref != null)
tref.Free ();
GC.SuppressFinalize (wrapper);
}