private bool _disposed; //false
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         this._disposed = true;
         this._performanceCounterInstance.RawValue = PerformanceHelper.getInitialValue(this._performanceCounterInstance.CounterType);
         this._performanceCounterInstance.Dispose();
     }
 }
        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                _disposed = true;
                _performanceCounterInstance.RawValue = PerformanceHelper.getInitialValue(_performanceCounterInstance.CounterType);
                _performanceCounterInstance.Dispose();

                if (_performanceCounterBaseInstance != null)
                {
                    _performanceCounterInstance.Dispose();
                }
            }
        }