[This is preliminary documentation and is subject to change.]
Checks to see if the IDisposable reference is not null and sets it to null in a thread-safe way then calls Dispose().
Returns false if it is already null or not the original reference
Namespace: NFXAssembly: NFX (in NFX.dll) Version: 3.0.0.1 (3.0.0.1)
public static bool DisposeAndNull<T>(
ref T obj
)
where T : class, IDisposable
public static bool DisposeAndNull<T>(
ref T obj
)
where T : class, IDisposable
Public Shared Function DisposeAndNull(Of T As {Class, IDisposable}) (
ByRef obj As T
) As Boolean
Public Shared Function DisposeAndNull(Of T As {Class, IDisposable}) (
ByRef obj As T
) As Boolean
public:
generic<typename T>
where T : ref class, IDisposable
static bool DisposeAndNull(
T% obj
)
public:
generic<typename T>
where T : ref class, IDisposable
static bool DisposeAndNull(
T% obj
)
static member DisposeAndNull :
obj : 'T byref -> bool when 'T : not struct and IDisposable
static member DisposeAndNull :
obj : 'T byref -> bool when 'T : not struct and IDisposable
- T
Return Value
Type:
Boolean