aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteAvatarData.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-11-14 04:45:59 +0000
committerJustin Clark-Casey (justincc)2012-11-14 04:45:59 +0000
commit94da908813e42c328572bc5da2ddc41b6664b59c (patch)
tree1a3e1ffaadb34cac64c798f5cc06eadf612c6af9 /OpenSim/Data/SQLite/SQLiteAvatarData.cs
parentIf no ISimulationDataStore or IEstateDataStore implementations could be loade... (diff)
downloadopensim-SC_OLD-94da908813e42c328572bc5da2ddc41b6664b59c.zip
opensim-SC_OLD-94da908813e42c328572bc5da2ddc41b6664b59c.tar.gz
opensim-SC_OLD-94da908813e42c328572bc5da2ddc41b6664b59c.tar.bz2
opensim-SC_OLD-94da908813e42c328572bc5da2ddc41b6664b59c.tar.xz
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.
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteAvatarData.cs')
-rw-r--r--OpenSim/Data/SQLite/SQLiteAvatarData.cs22
1 files changed, 8 insertions, 14 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteAvatarData.cs b/OpenSim/Data/SQLite/SQLiteAvatarData.cs
index faf34da..c6d615b 100644
--- a/OpenSim/Data/SQLite/SQLiteAvatarData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAvatarData.cs
@@ -56,23 +56,17 @@ namespace OpenSim.Data.SQLite
56 56
57 public bool Delete(UUID principalID, string name) 57 public bool Delete(UUID principalID, string name)
58 { 58 {
59 SqliteCommand cmd = new SqliteCommand(); 59 using (SqliteCommand cmd = new SqliteCommand())
60
61 cmd.CommandText = String.Format("delete from {0} where `PrincipalID` = :PrincipalID and `Name` = :Name", m_Realm);
62 cmd.Parameters.AddWithValue(":PrincipalID", principalID.ToString());
63 cmd.Parameters.AddWithValue(":Name", name);
64
65 try
66 { 60 {
61 cmd.CommandText = String.Format("delete from {0} where `PrincipalID` = :PrincipalID and `Name` = :Name", m_Realm);
62 cmd.Parameters.AddWithValue(":PrincipalID", principalID.ToString());
63 cmd.Parameters.AddWithValue(":Name", name);
64
67 if (ExecuteNonQuery(cmd, m_Connection) > 0) 65 if (ExecuteNonQuery(cmd, m_Connection) > 0)
68 return true; 66 return true;
69
70 return false;
71 }
72 finally
73 {
74 //CloseCommand(cmd);
75 } 67 }
68
69 return false;
76 } 70 }
77 } 71 }
78} 72} \ No newline at end of file