protected virtual void Dispose(bool disposing) { if (disposing) { _moduleHandle.Dispose(); } }
private void _backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { _dialog.StopProgressDialog(); Marshal.ReleaseComObject(_dialog); _dialog = null; if (_currentAnimationModuleHandle != null) { _currentAnimationModuleHandle.Dispose(); _currentAnimationModuleHandle = null; } OnRunWorkerCompleted(new RunWorkerCompletedEventArgs((!e.Cancelled && e.Error == null) ? e.Result : null, e.Error, e.Cancelled)); }