private void Dispose(bool finalizing) { lock (this) { if (_isDisposed) { return; } _isDisposed = true; if (Closing != null) { Closing.Invoke(this, EventArgs.Empty); } if (_journalAppender != null) { _journalAppender.Dispose(); } if (finalizing) { return; } //todo: bad dependency, use events instead Core.Config.Engines.Remove(this); if (_config.SnapshotBehavior == SnapshotBehavior.OnShutdown) { CreateSnapshot(); } GC.SuppressFinalize(this); } }
private void Dispose(bool disposing) { if (_isDisposed) { return; } if (disposing) { _journalAppender.Dispose(); //todo: bad dependency, use events instead Core.Config.Engines.Remove(this); if (_config.SnapshotBehavior == SnapshotBehavior.OnShutdown) { CreateSnapshot(); } _isDisposed = true; GC.SuppressFinalize(this); } }