private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // TODO: dispose managed state (managed objects). d3dImage.Dispose(); } GenLock.TimerStop(); ShutdownD3D(); // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }
private void UnitializeImageSource() { Source = null; if (_d3D11Image != null) { _d3D11Image.IsFrontBufferAvailableChanged -= OnIsFrontBufferAvailableChanged; _d3D11Image.Dispose(); _d3D11Image = null; } if (_sharedRenderTarget != null) { _sharedRenderTarget.Dispose(); _sharedRenderTarget = null; } if (_cachedRenderTarget != null) { _cachedRenderTarget.Dispose(); _cachedRenderTarget = null; } }
public void Release() { NativeMethods.Release(); _dxImage.Dispose(); }