/// <summary> /// Disposes of the command and clears all member variables /// </summary> /// <param name="disposing">Whether or not the class is being explicitly or implicitly disposed</param> protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { // If a reader is active on this command, don't destroy the command, instead let the reader do it SqliteDataReader reader = null; if (_activeReader != null) { try { reader = _activeReader.Target as SqliteDataReader; } catch { } } if (reader != null) { reader._disposeCommand = true; _activeReader = null; return; } Connection = null; _parameterCollection.Clear(); _commandText = null; } }
/// <summary> /// Disposes of the command and clears all member variables /// </summary> /// <param name="disposing">Whether or not the class is being explicitly or implicitly disposed</param> protected override void Dispose(bool disposing) { base.Dispose(disposing); // If a reader is active on this command, don't destroy it completely if (_activeReader != null) { _activeReader._disposeCommand = true; return; } Connection = null; _parameterCollection.Clear(); _commandText = null; }