aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLEstateData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLEstateData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLEstateData.cs26
1 files changed, 16 insertions, 10 deletions
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
index fe1487b..eeedf02 100644
--- a/OpenSim/Data/MySQL/MySQLEstateData.cs
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -82,6 +82,7 @@ namespace OpenSim.Data.MySQL
82 82
83 Migration m = new Migration(dbcon, Assembly, "EstateStore"); 83 Migration m = new Migration(dbcon, Assembly, "EstateStore");
84 m.Update(); 84 m.Update();
85 dbcon.Close();
85 86
86 Type t = typeof(EstateSettings); 87 Type t = typeof(EstateSettings);
87 m_Fields = t.GetFields(BindingFlags.NonPublic | 88 m_Fields = t.GetFields(BindingFlags.NonPublic |
@@ -143,7 +144,6 @@ namespace OpenSim.Data.MySQL
143 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 144 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
144 { 145 {
145 dbcon.Open(); 146 dbcon.Open();
146
147 cmd.Connection = dbcon; 147 cmd.Connection = dbcon;
148 148
149 bool found = false; 149 bool found = false;
@@ -171,6 +171,8 @@ namespace OpenSim.Data.MySQL
171 } 171 }
172 } 172 }
173 } 173 }
174 dbcon.Close();
175 cmd.Connection = null;
174 176
175 if (!found && create) 177 if (!found && create)
176 { 178 {
@@ -231,6 +233,7 @@ namespace OpenSim.Data.MySQL
231 233
232 es.Save(); 234 es.Save();
233 } 235 }
236 dbcon.Close();
234 } 237 }
235 } 238 }
236 239
@@ -263,6 +266,7 @@ namespace OpenSim.Data.MySQL
263 266
264 cmd.ExecuteNonQuery(); 267 cmd.ExecuteNonQuery();
265 } 268 }
269 dbcon.Close();
266 } 270 }
267 271
268 SaveBanList(es); 272 SaveBanList(es);
@@ -300,6 +304,7 @@ namespace OpenSim.Data.MySQL
300 } 304 }
301 } 305 }
302 } 306 }
307 dbcon.Close();
303 } 308 }
304 } 309 }
305 310
@@ -329,6 +334,7 @@ namespace OpenSim.Data.MySQL
329 cmd.Parameters.Clear(); 334 cmd.Parameters.Clear();
330 } 335 }
331 } 336 }
337 dbcon.Close();
332 } 338 }
333 } 339 }
334 340
@@ -358,6 +364,7 @@ namespace OpenSim.Data.MySQL
358 cmd.Parameters.Clear(); 364 cmd.Parameters.Clear();
359 } 365 }
360 } 366 }
367 dbcon.Close();
361 } 368 }
362 } 369 }
363 370
@@ -383,6 +390,7 @@ namespace OpenSim.Data.MySQL
383 } 390 }
384 } 391 }
385 } 392 }
393 dbcon.Close();
386 } 394 }
387 395
388 return uuids.ToArray(); 396 return uuids.ToArray();
@@ -403,19 +411,19 @@ namespace OpenSim.Data.MySQL
403 return e; 411 return e;
404 } 412 }
405 } 413 }
406 414
407 public List<EstateSettings> LoadEstateSettingsAll() 415 public List<EstateSettings> LoadEstateSettingsAll()
408 { 416 {
409 List<EstateSettings> allEstateSettings = new List<EstateSettings>(); 417 List<EstateSettings> allEstateSettings = new List<EstateSettings>();
410 418
411 List<int> allEstateIds = GetEstatesAll(); 419 List<int> allEstateIds = GetEstatesAll();
412 420
413 foreach (int estateId in allEstateIds) 421 foreach (int estateId in allEstateIds)
414 allEstateSettings.Add(LoadEstateSettings(estateId)); 422 allEstateSettings.Add(LoadEstateSettings(estateId));
415 423
416 return allEstateSettings; 424 return allEstateSettings;
417 } 425 }
418 426
419 public List<int> GetEstatesAll() 427 public List<int> GetEstatesAll()
420 { 428 {
421 List<int> result = new List<int>(); 429 List<int> result = new List<int>();
@@ -437,11 +445,10 @@ namespace OpenSim.Data.MySQL
437 reader.Close(); 445 reader.Close();
438 } 446 }
439 } 447 }
440
441 dbcon.Close(); 448 dbcon.Close();
442 } 449 }
443 450
444 return result; 451 return result;
445 } 452 }
446 453
447 public List<int> GetEstates(string search) 454 public List<int> GetEstates(string search)
@@ -466,7 +473,6 @@ namespace OpenSim.Data.MySQL
466 reader.Close(); 473 reader.Close();
467 } 474 }
468 } 475 }
469
470 dbcon.Close(); 476 dbcon.Close();
471 } 477 }
472 478