System.Data.SQLite

Check-in [f629afe04c]
Login

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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f629afe04ceb19a9f4489de5f9b4185ba37b604f
User & Date: mistachkin 2013-09-05 05:26:13.394
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
Side-by-Side Diff Ignore Whitespace Patch
Changes to System.Data.SQLite/SQLiteCommand.cs.
277
278
279
280
281
282
283


















284
285
286
287
288
289
290
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







        }

        return SQLiteConnectionFlags.Default;
    }

    ///////////////////////////////////////////////////////////////////////////////////////////////

    private void DisposeStatements()
    {
        if (_statementList == null) return;

        int x = _statementList.Count;

        for (int n = 0; n < x; n++)
        {
            SQLiteStatement stmt = _statementList[n];
            if (stmt == null) continue;
            stmt.Dispose();
        }

        _statementList = null;
    }

    ///////////////////////////////////////////////////////////////////////////////////////////////

    /// <summary>
    /// Clears and destroys all statements currently prepared
    /// </summary>
    internal void ClearCommands()
    {
      if (_activeReader != null)
      {
299
300
301
302
303
304
305
306
307
308
309
310
311
312

313
314
315
316
317
318
319
317
318
319
320
321
322
323







324
325
326
327
328
329
330
331







-
-
-
-
-
-
-
+








        if (reader != null)
          reader.Close();

        _activeReader = null;
      }

      if (_statementList == null) return;

      int x = _statementList.Count;
      for (int n = 0; n < x; n++)
        _statementList[n].Dispose();

      _statementList = null;
      DisposeStatements();

      _parameterCollection.Unbind();
    }

    /// <summary>
    /// Builds an array of prepared statements for each complete SQL statement in the command text
    /// </summary>