Consistently use using() to make sure we dispose of used MySqlCommands where this is not already being done.

This commit is contained in:
Justin Clark-Casey (justincc)
2012-04-30 15:54:35 +01:00
parent 8380166251
commit 522eff6138
9 changed files with 446 additions and 431 deletions

View File

@@ -329,11 +329,12 @@ namespace OpenSim.Data.MySQL
if (scopeID != UUID.Zero)
command += " and ScopeID = ?scopeID";
MySqlCommand cmd = new MySqlCommand(command);
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
return RunCommand(cmd);
using (MySqlCommand cmd = new MySqlCommand(command))
{
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
return RunCommand(cmd);
}
}
}
}
}