From 522eff61383e9a8acfdf34289cd64a8fdc27bb19 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 30 Apr 2012 15:54:35 +0100 Subject: Consistently use using() to make sure we dispose of used MySqlCommands where this is not already being done. --- OpenSim/Data/MySQL/MySQLRegionData.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'OpenSim/Data/MySQL/MySQLRegionData.cs') diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index d1f1932..0614879 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -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); + } } } -} +} \ No newline at end of file -- cgit v1.1