diff options
author | Justin Clark-Casey (justincc) | 2012-04-30 15:54:35 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-04-30 15:54:35 +0100 |
commit | 522eff61383e9a8acfdf34289cd64a8fdc27bb19 (patch) | |
tree | 3e9d6428bf6832caafd69d45c3a377a9f643dcae /OpenSim/Data/MySQL/MySQLAvatarData.cs | |
parent | Comment out debug [ASYNC DELETER] messages for now. (diff) | |
download | opensim-SC_OLD-522eff61383e9a8acfdf34289cd64a8fdc27bb19.zip opensim-SC_OLD-522eff61383e9a8acfdf34289cd64a8fdc27bb19.tar.gz opensim-SC_OLD-522eff61383e9a8acfdf34289cd64a8fdc27bb19.tar.bz2 opensim-SC_OLD-522eff61383e9a8acfdf34289cd64a8fdc27bb19.tar.xz |
Consistently use using() to make sure we dispose of used MySqlCommands where this is not already being done.
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLAvatarData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAvatarData.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAvatarData.cs b/OpenSim/Data/MySQL/MySQLAvatarData.cs index 8c841ab..6a2f5d8 100644 --- a/OpenSim/Data/MySQL/MySQLAvatarData.cs +++ b/OpenSim/Data/MySQL/MySQLAvatarData.cs | |||
@@ -52,14 +52,15 @@ namespace OpenSim.Data.MySQL | |||
52 | 52 | ||
53 | public bool Delete(UUID principalID, string name) | 53 | public bool Delete(UUID principalID, string name) |
54 | { | 54 | { |
55 | MySqlCommand cmd = new MySqlCommand(); | 55 | using (MySqlCommand cmd = new MySqlCommand()) |
56 | 56 | { | |
57 | cmd.CommandText = String.Format("delete from {0} where `PrincipalID` = ?PrincipalID and `Name` = ?Name", m_Realm); | 57 | cmd.CommandText = String.Format("delete from {0} where `PrincipalID` = ?PrincipalID and `Name` = ?Name", m_Realm); |
58 | cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString()); | 58 | cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString()); |
59 | cmd.Parameters.AddWithValue("?Name", name); | 59 | cmd.Parameters.AddWithValue("?Name", name); |
60 | 60 | ||
61 | if (ExecuteNonQuery(cmd) > 0) | 61 | if (ExecuteNonQuery(cmd) > 0) |
62 | return true; | 62 | return true; |
63 | } | ||
63 | 64 | ||
64 | return false; | 65 | return false; |
65 | } | 66 | } |