/// <summary> /// Disposer. Release resources and cleanup. /// </summary> /// <param name="disposing">true to dispose managed resources</param> protected virtual void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!_disposed) { Log.Debug(); if (disposing) { if (_actuators != null) { // dispose all managed resources. foreach (var actuator in _actuators.Collection) { actuator.Dispose(); } _actuators.Dispose(); } } // Release unmanaged resources. } _disposed = true; }
/// <summary> /// Disposer. Release resources and cleanup. /// </summary> /// <param name="disposing">true to dispose managed resources</param> protected virtual void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!_disposed) { Log.Debug(); if (disposing) { _exitThread = true; calibrationQueue.Clear(); calibrationQueue.Enqueue("Stop"); Log.Debug("Calling thread.join"); _thread.Join(2000); Log.Debug("Exited thread"); if (_actuators != null) { _actuators.Dispose(); } } // Release unmanaged resources. } _disposed = true; }