void NDirect::FreeNativeLibrary(NATIVE_LIBRARY_HANDLE handle)
{
STANDARD_VM_CONTRACT;
-
- // FreeLibrary doesn't throw if the input is null.
- // This avoids further null propagation/check while freeing resources (ex: in finally blocks)
- if (handle == NULL)
- return;
+ _ASSERTE(handle != NULL);
#ifndef FEATURE_PAL
BOOL retVal = FreeLibrary(handle);
/// <param name="handle">The native library handle to be freed</param>
public static void Free(IntPtr handle)
{
+ if (handle == IntPtr.Zero)
+ return;
FreeLib(handle);
}