More consistently dispose of SqliteCommand in OpenSim.Data.SQLite where possible.

Not doing SQLiteInventoryStore since this is no longer used and should disappear in the future.
This commit is contained in:
Justin Clark-Casey (justincc)
2012-11-14 04:45:59 +00:00
parent 2ccb53b42d
commit 94da908813
9 changed files with 321 additions and 314 deletions

View File

@@ -202,7 +202,8 @@ namespace OpenSim.Data.SQLite
/// <returns>True if exist, or false.</returns>
override public bool ExistsAsset(UUID uuid)
{
lock (this) {
lock (this)
{
using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString()));
@@ -353,12 +354,13 @@ namespace OpenSim.Data.SQLite
{
lock (this)
{
using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString()));
cmd.ExecuteNonQuery();
}
using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString()));
cmd.ExecuteNonQuery();
}
}
return true;
}