Freigeben über


SafeHandle.DangerousRelease-Methode: ()

 

Veröffentlicht: Oktober 2016

Dekrementiert manuell den Verweiszähler für eine SafeHandle-Instanz.

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

Syntax

[SecurityCriticalAttribute]
public void DangerousRelease()
public:
[SecurityCriticalAttribute]
void DangerousRelease()
[<SecurityCriticalAttribute>]
member DangerousRelease : unit -> unit
<SecurityCriticalAttribute>
Public Sub DangerousRelease

Hinweise

The M:System.Runtime.InteropServices.SafeHandle.DangerousRelease method is the counterpart to M:System.Runtime.InteropServices.SafeHandle.DangerousAddRef(System.Boolean@). You should always match a call to the M:System.Runtime.InteropServices.SafeHandle.DangerousRelease method with a successful call to M:System.Runtime.InteropServices.SafeHandle.DangerousAddRef(System.Boolean@).

Warnung

This method is intended for advanced users and must always be used carefully. To avoid leaking handle resources, always call this method inside a constrained execution region (CER), where a thread abort cannot interrupt processing. In the same way that unmatched M:System.Runtime.InteropServices.SafeHandle.DangerousAddRef(System.Boolean@) calls can cause resource leaks, unmatched M:System.Runtime.InteropServices.SafeHandle.DangerousRelease calls can cause invalid handle states to become visible to other threads. Do not expose M:System.Runtime.InteropServices.SafeHandle.DangerousAddRef(System.Boolean@) or M:System.Runtime.InteropServices.SafeHandle.DangerousRelease calls to untrusted code.

Sicherheit

SecurityPermission

for permission to call unmanaged code. Security action: F:System.Security.Permissions.SecurityAction.LinkDemand. Associated enumeration: F:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode

Versionsinformationen

Universelle Windows-Plattform
Verfügbar seit 8
.NET Framework
Verfügbar seit 2.0
Portierbare Klassenbibliothek
Unterstützt in: portierbare .NET-Plattformen
Silverlight
Verfügbar seit 2.0
Windows Phone Silverlight
Verfügbar seit 7.0
Windows Phone
Verfügbar seit 8.1

Siehe auch

DangerousAddRef
SafeHandle-Klasse
System.Runtime.InteropServices-Namespace

Zurück zum Anfang