/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing">Result: <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (!isDisposed) { // Not already disposed ? if (disposing) { // dispose managed resources // Not already disposed ? if (updateHelper != null) { updateHelper.Dispose(); // Dispose it updateHelper = null; // Its now inaccessible } } // free unmanaged resources // Set large fields to null. // Instance is disposed isDisposed = true; } }