protected virtual void Dispose(bool disposing) { if (disposing) { // dispose managed resources if (RandomGenerator != null) { RandomGenerator.Dispose(); } RandomGenerator = null; TrainingSamples = null; TrainingSamples = null; RandomTrainingSample = null; ParallelOption = null; stopwatch = null; RaiseDataLoadedEvent = null; RaiseDataProgressEvent = null; } // free native resources }