A disposable reference to an object, used for reference counting. Methods of this class are thread-safe and nonblocking.

C# | Visual Basic | Managed C++ |
public sealed class DisposableRef<C> : IDisposableRef<C>, IDisposable where C : class
Public NotInheritable Class DisposableRef(Of C As Class) _ Implements IDisposableRef(Of C), IDisposable
generic<typename C> where C : ref class public ref class DisposableRef sealed : IDisposableRef<C>, IDisposable

- C
- Class of the object that the reference will point to.

All Members | Constructors | Methods | Properties | Fields | Events |
Icon | Member | Description |
---|---|---|
![]() | DisposableRef<(Of C>)New(C, ContextCallback, Object) |
Creates a disposable reference.
|
![]() | Dispose() |
Disposes the reference and invokes the callback given in the constructor. This call is nonblocking. The callback can access the target object.
|
![]() | Equals(Object) | (Inherited from Object.) |
![]() | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType() | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | Target |
Returns the target object that this reference is pointing to. Reading this property is nonblocking.
This property cannot be used after the object has been disposed. It is legal to read this property from the callback.
|
![]() | ToString() | (Inherited from Object.) |

Object | |
![]() | DisposableRef<(Of C>) |