public static void SafeDispose(this SafeHandleBase handle) { if (handle == null || handle.IsInvalid) { return; } handle.Dispose(); }
internal void RegisterForCleanup(SafeHandleBase handleToCleanup) { handlesToCleanup.Push(handleToCleanup); }