diff options
author | Melanie Thielker | 2008-11-29 21:24:54 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-11-29 21:24:54 +0000 |
commit | d579246257cfc5eb9a5268a4b2382f341b9c56e7 (patch) | |
tree | ad948b01dca6c65f38b30aa7ea0839ba9007ae06 /OpenSim/Data | |
parent | Fix usage of reflection where it isn't necessary. (diff) | |
download | opensim-SC-d579246257cfc5eb9a5268a4b2382f341b9c56e7.zip opensim-SC-d579246257cfc5eb9a5268a4b2382f341b9c56e7.tar.gz opensim-SC-d579246257cfc5eb9a5268a4b2382f341b9c56e7.tar.bz2 opensim-SC-d579246257cfc5eb9a5268a4b2382f341b9c56e7.tar.xz |
Explicitly Dispose() all cmd objects
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLRegionData.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index bd74166..af70d11 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs | |||
@@ -73,6 +73,7 @@ namespace OpenSim.Data.MySQL | |||
73 | "left join primshapes on prims.uuid = primshapes.uuid " + | 73 | "left join primshapes on prims.uuid = primshapes.uuid " + |
74 | "where PCode = 9 and State <> 0"; | 74 | "where PCode = 9 and State <> 0"; |
75 | ExecuteNonQuery(cmd); | 75 | ExecuteNonQuery(cmd); |
76 | cmd.Dispose(); | ||
76 | } | 77 | } |
77 | 78 | ||
78 | private IDataReader ExecuteReader(MySqlCommand c) | 79 | private IDataReader ExecuteReader(MySqlCommand c) |
@@ -256,6 +257,7 @@ namespace OpenSim.Data.MySQL | |||
256 | 257 | ||
257 | ExecuteNonQuery(cmd); | 258 | ExecuteNonQuery(cmd); |
258 | } | 259 | } |
260 | cmd.Dispose(); | ||
259 | } | 261 | } |
260 | } | 262 | } |
261 | 263 | ||
@@ -304,12 +306,13 @@ namespace OpenSim.Data.MySQL | |||
304 | cmd.CommandText = "delete from primshapes where UUID = ?UUID"; | 306 | cmd.CommandText = "delete from primshapes where UUID = ?UUID"; |
305 | 307 | ||
306 | ExecuteNonQuery(cmd); | 308 | ExecuteNonQuery(cmd); |
309 | cmd.Dispose(); | ||
307 | } | 310 | } |
308 | } | 311 | } |
309 | 312 | ||
310 | /// <summary> | 313 | /// <summary> |
311 | /// Remove all persisted items of the given prim. | 314 | /// Remove all persisted items of the given prim. |
312 | /// The caller must acquire the necessrary synchronization locks and commit or rollback changes. | 315 | /// The caller must acquire the necessrary synchronization locks |
313 | /// </summary> | 316 | /// </summary> |
314 | /// <param name="uuid">the Item UUID</param> | 317 | /// <param name="uuid">the Item UUID</param> |
315 | private void RemoveItems(UUID uuid) | 318 | private void RemoveItems(UUID uuid) |
@@ -324,6 +327,7 @@ namespace OpenSim.Data.MySQL | |||
324 | cmd.Parameters.AddWithValue("PrimID", uuid.ToString()); | 327 | cmd.Parameters.AddWithValue("PrimID", uuid.ToString()); |
325 | 328 | ||
326 | ExecuteNonQuery(cmd); | 329 | ExecuteNonQuery(cmd); |
330 | cmd.Dispose(); | ||
327 | } | 331 | } |
328 | } | 332 | } |
329 | 333 | ||
@@ -397,6 +401,7 @@ namespace OpenSim.Data.MySQL | |||
397 | 401 | ||
398 | if (grp != null) | 402 | if (grp != null) |
399 | objects.Add(grp); | 403 | objects.Add(grp); |
404 | cmd.Dispose(); | ||
400 | } | 405 | } |
401 | 406 | ||
402 | foreach (SceneObjectPart part in prims) | 407 | foreach (SceneObjectPart part in prims) |
@@ -442,6 +447,7 @@ namespace OpenSim.Data.MySQL | |||
442 | reader.Close(); | 447 | reader.Close(); |
443 | } | 448 | } |
444 | 449 | ||
450 | cmd.Dispose(); | ||
445 | prim.Inventory.RestoreInventoryItems(inventory); | 451 | prim.Inventory.RestoreInventoryItems(inventory); |
446 | } | 452 | } |
447 | } | 453 | } |
@@ -469,6 +475,7 @@ namespace OpenSim.Data.MySQL | |||
469 | SerializeTerrain(ter)); | 475 | SerializeTerrain(ter)); |
470 | 476 | ||
471 | ExecuteNonQuery(cmd); | 477 | ExecuteNonQuery(cmd); |
478 | cmd.Dispose(); | ||
472 | } | 479 | } |
473 | } | 480 | } |
474 | 481 | ||
@@ -513,6 +520,7 @@ namespace OpenSim.Data.MySQL | |||
513 | { | 520 | { |
514 | reader.Close(); | 521 | reader.Close(); |
515 | } | 522 | } |
523 | cmd.Dispose(); | ||
516 | } | 524 | } |
517 | 525 | ||
518 | return null; | 526 | return null; |
@@ -529,6 +537,7 @@ namespace OpenSim.Data.MySQL | |||
529 | cmd.Parameters.AddWithValue("UUID", Util.ToRawUuidString(globalID)); | 537 | cmd.Parameters.AddWithValue("UUID", Util.ToRawUuidString(globalID)); |
530 | 538 | ||
531 | ExecuteNonQuery(cmd); | 539 | ExecuteNonQuery(cmd); |
540 | cmd.Dispose(); | ||
532 | } | 541 | } |
533 | } | 542 | } |
534 | 543 | ||
@@ -580,6 +589,7 @@ namespace OpenSim.Data.MySQL | |||
580 | ExecuteNonQuery(cmd); | 589 | ExecuteNonQuery(cmd); |
581 | cmd.Parameters.Clear(); | 590 | cmd.Parameters.Clear(); |
582 | } | 591 | } |
592 | cmd.Dispose(); | ||
583 | } | 593 | } |
584 | } | 594 | } |
585 | 595 | ||
@@ -617,6 +627,7 @@ namespace OpenSim.Data.MySQL | |||
617 | { | 627 | { |
618 | reader.Close(); | 628 | reader.Close(); |
619 | } | 629 | } |
630 | cmd.Dispose(); | ||
620 | } | 631 | } |
621 | 632 | ||
622 | return rs; | 633 | return rs; |
@@ -662,6 +673,7 @@ namespace OpenSim.Data.MySQL | |||
662 | FillRegionSettingsCommand(cmd, rs); | 673 | FillRegionSettingsCommand(cmd, rs); |
663 | 674 | ||
664 | ExecuteNonQuery(cmd); | 675 | ExecuteNonQuery(cmd); |
676 | cmd.Dispose(); | ||
665 | } | 677 | } |
666 | } | 678 | } |
667 | 679 | ||
@@ -718,6 +730,7 @@ namespace OpenSim.Data.MySQL | |||
718 | reader.Close(); | 730 | reader.Close(); |
719 | } | 731 | } |
720 | } | 732 | } |
733 | cmd.Dispose(); | ||
721 | } | 734 | } |
722 | 735 | ||
723 | return landData; | 736 | return landData; |
@@ -1435,6 +1448,7 @@ byte[] textureEntry = (byte[]) row["Texture"]; | |||
1435 | 1448 | ||
1436 | ExecuteNonQuery(cmd); | 1449 | ExecuteNonQuery(cmd); |
1437 | } | 1450 | } |
1451 | cmd.Dispose(); | ||
1438 | } | 1452 | } |
1439 | } | 1453 | } |
1440 | } | 1454 | } |