/// <summary> /// Call this method to free unmanaged resources associated with current instance. /// </summary> /// <seealso cref="Disposed"/> /// <seealso cref="IsDisposed"/> public void Dispose() { isDisposed = true; if (!handle.IsDisposed) { Shutdown(); } handle.Dispose(); }
/// <summary> /// Call this method to free unmanaged resources associated with current instance. /// </summary> /// <remarks><para> /// Under the hood, reference counter is decremented on this call. When the references reach zero the unmanaged resources are destroyed. /// (Multiple objects of <see cref="Image"/> can reference one and the same image. For details see <see cref="DuplicateReference"/>.) /// </para><para> /// Can be called multiple times but event <see cref="Disposed"/> will be raised only once. /// </para></remarks> /// <seealso cref="Disposed"/> /// <seealso cref="IsDisposed"/> /// <seealso cref="DuplicateReference"/> public void Dispose() => handle.Dispose();
/// <summary> /// Call this method to free unmanaged resources associated with current instance. /// </summary> /// <remarks><para> /// Under the hood, reference counter is decremented on this call. When the references reach zero the unmanaged resources are destroyed. /// (Multiple objects of <see cref="Capture"/> can reference one and the same capture. For details see <see cref="DuplicateReference"/>.) /// </para><para> /// Can be called multiple times but event <see cref="Disposed"/> will be raised only once. /// </para></remarks> /// <seealso cref="Disposed"/> /// <seealso cref="IsDisposed"/> /// <seealso cref="DuplicateReference"/> public void Dispose() { children.Dispose(); handle.Dispose(); }