System.Data.SQLite
Check-in [f629afe04c]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Move the statement list disposal code in the SQLiteCommand class into its own method.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f629afe04ceb19a9f4489de5f9b4185ba37b604f
User & Date: mistachkin 2013-09-05 05:26:13
Context
2013-09-06
04:29
Raise the static SQLiteConnection.Changed event when any SQLiteCommand, SQLiteDataReader, or CriticalHandle derived object instance is created. Fix for [aba4549801]. Update Eagle in externals to pickup fixes necessary for testing. check-in: 7e2f11fd49 user: mistachkin tags: trunk
2013-09-05
05:26
Move the statement list disposal code in the SQLiteCommand class into its own method. check-in: f629afe04c user: mistachkin tags: trunk
2013-09-04
04:23
Update SQLite core library to the latest trunk. Update version history docs. check-in: e75a92a9dc user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLiteCommand.cs.

   277    277           }
   278    278   
   279    279           return SQLiteConnectionFlags.Default;
   280    280       }
   281    281   
   282    282       ///////////////////////////////////////////////////////////////////////////////////////////////
   283    283   
          284  +    private void DisposeStatements()
          285  +    {
          286  +        if (_statementList == null) return;
          287  +
          288  +        int x = _statementList.Count;
          289  +
          290  +        for (int n = 0; n < x; n++)
          291  +        {
          292  +            SQLiteStatement stmt = _statementList[n];
          293  +            if (stmt == null) continue;
          294  +            stmt.Dispose();
          295  +        }
          296  +
          297  +        _statementList = null;
          298  +    }
          299  +
          300  +    ///////////////////////////////////////////////////////////////////////////////////////////////
          301  +
   284    302       /// <summary>
   285    303       /// Clears and destroys all statements currently prepared
   286    304       /// </summary>
   287    305       internal void ClearCommands()
   288    306       {
   289    307         if (_activeReader != null)
   290    308         {
................................................................................
   299    317   
   300    318           if (reader != null)
   301    319             reader.Close();
   302    320   
   303    321           _activeReader = null;
   304    322         }
   305    323   
   306         -      if (_statementList == null) return;
   307         -
   308         -      int x = _statementList.Count;
   309         -      for (int n = 0; n < x; n++)
   310         -        _statementList[n].Dispose();
   311         -
   312         -      _statementList = null;
          324  +      DisposeStatements();
   313    325   
   314    326         _parameterCollection.Unbind();
   315    327       }
   316    328   
   317    329       /// <summary>
   318    330       /// Builds an array of prepared statements for each complete SQL statement in the command text
   319    331       /// </summary>