diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-08 16:58:52 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-08 16:58:52 -0400 |
| commit | fbd052abfc2724fcb151582746c9783d7ab8a97a (patch) | |
| tree | 4b3e126d72aa53e6aa4e74c74380bdcb80bc412c /MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs | |
| parent | a0dfbdfd70fe85fca64b341b6fe30708e9a9ebe9 (diff) | |
removed local trailers and special features from memory
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs index 897ece764..6aeb63d9b 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs @@ -121,13 +121,14 @@ namespace MediaBrowser.Server.Implementations.Sqlite { try { - var cmd = connection.CreateCommand(); - - foreach (var query in queries) + using (var cmd = connection.CreateCommand()) { - cmd.Transaction = tran; - cmd.CommandText = query; - cmd.ExecuteNonQuery(); + foreach (var query in queries) + { + cmd.Transaction = tran; + cmd.CommandText = query; + cmd.ExecuteNonQuery(); + } } tran.Commit(); @@ -268,6 +269,9 @@ namespace MediaBrowser.Server.Implementations.Sqlite command.Transaction = tran; command.ExecuteNonQuery(); + + command.Dispose(); + numCommands++; } |
