Added NoOptimization attribute to SafeHANDLE disposal method

pull/60/head
David Hall 2019-06-25 17:12:28 -06:00
parent 34ce5635ff
commit f7dd0a9cf6
1 changed files with 2 additions and 0 deletions

View File

@ -1,5 +1,6 @@
using Microsoft.Win32.SafeHandles;
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke
@ -2013,6 +2014,7 @@ namespace Vanara.PInvoke
protected abstract bool InternalReleaseHandle();
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
protected override bool ReleaseHandle()
{
if (IsInvalid) return true;