Explicitly Dispose() all cmd objects

0.6.1-post-fixes
Melanie Thielker 2008-11-29 21:24:54 +00:00
parent aaba3c342f
commit d579246257
1 changed files with 15 additions and 1 deletions

View File

@ -73,6 +73,7 @@ namespace OpenSim.Data.MySQL
"left join primshapes on prims.uuid = primshapes.uuid " + "left join primshapes on prims.uuid = primshapes.uuid " +
"where PCode = 9 and State <> 0"; "where PCode = 9 and State <> 0";
ExecuteNonQuery(cmd); ExecuteNonQuery(cmd);
cmd.Dispose();
} }
private IDataReader ExecuteReader(MySqlCommand c) private IDataReader ExecuteReader(MySqlCommand c)
@ -256,6 +257,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd); ExecuteNonQuery(cmd);
} }
cmd.Dispose();
} }
} }
@ -304,12 +306,13 @@ namespace OpenSim.Data.MySQL
cmd.CommandText = "delete from primshapes where UUID = ?UUID"; cmd.CommandText = "delete from primshapes where UUID = ?UUID";
ExecuteNonQuery(cmd); ExecuteNonQuery(cmd);
cmd.Dispose();
} }
} }
/// <summary> /// <summary>
/// Remove all persisted items of the given prim. /// Remove all persisted items of the given prim.
/// The caller must acquire the necessrary synchronization locks and commit or rollback changes. /// The caller must acquire the necessrary synchronization locks
/// </summary> /// </summary>
/// <param name="uuid">the Item UUID</param> /// <param name="uuid">the Item UUID</param>
private void RemoveItems(UUID uuid) private void RemoveItems(UUID uuid)
@ -324,6 +327,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("PrimID", uuid.ToString()); cmd.Parameters.AddWithValue("PrimID", uuid.ToString());
ExecuteNonQuery(cmd); ExecuteNonQuery(cmd);
cmd.Dispose();
} }
} }
@ -397,6 +401,7 @@ namespace OpenSim.Data.MySQL
if (grp != null) if (grp != null)
objects.Add(grp); objects.Add(grp);
cmd.Dispose();
} }
foreach (SceneObjectPart part in prims) foreach (SceneObjectPart part in prims)
@ -442,6 +447,7 @@ namespace OpenSim.Data.MySQL
reader.Close(); reader.Close();
} }
cmd.Dispose();
prim.Inventory.RestoreInventoryItems(inventory); prim.Inventory.RestoreInventoryItems(inventory);
} }
} }
@ -469,6 +475,7 @@ namespace OpenSim.Data.MySQL
SerializeTerrain(ter)); SerializeTerrain(ter));
ExecuteNonQuery(cmd); ExecuteNonQuery(cmd);
cmd.Dispose();
} }
} }
@ -513,6 +520,7 @@ namespace OpenSim.Data.MySQL
{ {
reader.Close(); reader.Close();
} }
cmd.Dispose();
} }
return null; return null;
@ -529,6 +537,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("UUID", Util.ToRawUuidString(globalID)); cmd.Parameters.AddWithValue("UUID", Util.ToRawUuidString(globalID));
ExecuteNonQuery(cmd); ExecuteNonQuery(cmd);
cmd.Dispose();
} }
} }
@ -580,6 +589,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd); ExecuteNonQuery(cmd);
cmd.Parameters.Clear(); cmd.Parameters.Clear();
} }
cmd.Dispose();
} }
} }
@ -617,6 +627,7 @@ namespace OpenSim.Data.MySQL
{ {
reader.Close(); reader.Close();
} }
cmd.Dispose();
} }
return rs; return rs;
@ -662,6 +673,7 @@ namespace OpenSim.Data.MySQL
FillRegionSettingsCommand(cmd, rs); FillRegionSettingsCommand(cmd, rs);
ExecuteNonQuery(cmd); ExecuteNonQuery(cmd);
cmd.Dispose();
} }
} }
@ -718,6 +730,7 @@ namespace OpenSim.Data.MySQL
reader.Close(); reader.Close();
} }
} }
cmd.Dispose();
} }
return landData; return landData;
@ -1435,6 +1448,7 @@ byte[] textureEntry = (byte[]) row["Texture"];
ExecuteNonQuery(cmd); ExecuteNonQuery(cmd);
} }
cmd.Dispose();
} }
} }
} }