public void Dispose() { _semaphore.Do(s => { s.Release(1); s.Dispose(); }); ProfilerRequestsInformation.Do(e => e.Dispose()); InformationReadyForProfiler.Do(e => e.Dispose()); InformationReadByProfiler.Do(e => e.Dispose()); StreamAccessorComms.Do(r => r.Dispose()); _memoryMappedFile.Do(f => f.Dispose()); PinnedDataCommunication.Free(); }
protected virtual void Dispose(bool disposing) { if (!_disposed && disposing) { _disposed = true; _semaphore .Try(s => s.Release(1)) .Do(s => s.Dispose()); ProfilerRequestsInformation.Do(e => e.Dispose()); InformationReadyForProfiler.Do(e => e.Dispose()); InformationReadByProfiler.Do(e => e.Dispose()); StreamAccessorComms.Do(r => r.Dispose()); _memoryMappedFile.Do(f => f.Dispose()); PinnedDataCommunication.Free(); } }