diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
index 8b808d311c..ae94252086 100644
--- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
@@ -156,6 +156,11 @@ namespace OpenSim.Data.MSSQL
//After this we have a empty fully configured DataSet.
}
+
+ ///
+ /// Dispose the database
+ ///
+ public void Dispose() {}
///
/// Loads the objects present in the region.
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index 9c36d49a02..284c9704fd 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -203,6 +203,8 @@ namespace OpenSim.Data.MySQL
}
}
+ public void Dispose() {}
+
///
/// Get the wait_timeout value for our connection
///
diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs
index 07bf05ce4a..ecb29feb26 100644
--- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs
@@ -105,6 +105,8 @@ namespace OpenSim.Data.NHibernate
*
**********************************************************************/
+ public void Dispose() {}
+
public void StoreRegionSettings(RegionSettings rs)
{
}
diff --git a/OpenSim/Data/Null/NullDataStore.cs b/OpenSim/Data/Null/NullDataStore.cs
index aea03d64de..94ad4afbae 100644
--- a/OpenSim/Data/Null/NullDataStore.cs
+++ b/OpenSim/Data/Null/NullDataStore.cs
@@ -43,6 +43,10 @@ namespace OpenSim.Data.Null
return;
}
+ public void Dispose()
+ {
+ }
+
public void StoreRegionSettings(RegionSettings rs)
{
}
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index 8b14f09106..17af2b05a0 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -56,7 +56,14 @@ namespace OpenSim.Data.SQLite
private SqliteConnection m_conn;
- override public void Dispose() { }
+ override public void Dispose()
+ {
+ if (m_conn != null)
+ {
+ m_conn.Close();
+ m_conn = null;
+ }
+ }
///
///
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
index ca7e612513..49d351afe6 100644
--- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
+++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
@@ -46,6 +46,7 @@ namespace OpenSim.Data.SQLite
private const string invItemsSelect = "select * from inventoryitems";
private const string invFoldersSelect = "select * from inventoryfolders";
+ private SqliteConnection conn;
private DataSet ds;
private SqliteDataAdapter invItemsDa;
private SqliteDataAdapter invFoldersDa;
@@ -71,7 +72,7 @@ namespace OpenSim.Data.SQLite
dbconnect = "URI=file:inventoryStore.db,version=3";
}
m_log.Info("[INVENTORY DB]: Sqlite - connecting: " + dbconnect);
- SqliteConnection conn = new SqliteConnection(dbconnect);
+ conn = new SqliteConnection(dbconnect);
conn.Open();
@@ -101,6 +102,29 @@ namespace OpenSim.Data.SQLite
ds.AcceptChanges();
}
+ ///
+ /// Closes the inventory interface
+ ///
+ public void Dispose()
+ {
+ if(conn != null) {
+ conn.Close();
+ conn = null;
+ }
+ if(invItemsDa != null) {
+ invItemsDa.Dispose();
+ invItemsDa = null;
+ }
+ if(invFoldersDa != null) {
+ invFoldersDa.Dispose();
+ invFoldersDa = null;
+ }
+ if(ds != null) {
+ ds.Dispose();
+ ds = null;
+ }
+ }
+
///
///
///
@@ -277,13 +301,6 @@ namespace OpenSim.Data.SQLite
// TODO: DataSet commit
}
- ///
- /// Closes the inventory interface
- ///
- public void Dispose()
- {
- }
-
///
/// The name of this DB provider
///
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 36b3d2f6cb..f71535f7d4 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -203,6 +203,46 @@ namespace OpenSim.Data.SQLite
}
}
+ public void Dispose()
+ {
+ if(m_conn != null) {
+ m_conn.Close();
+ m_conn = null;
+ }
+ if(ds != null) {
+ ds.Dispose();
+ ds = null;
+ }
+ if(primDa != null) {
+ primDa.Dispose();
+ primDa = null;
+ }
+ if(shapeDa != null) {
+ shapeDa.Dispose();
+ shapeDa = null;
+ }
+ if(itemsDa != null) {
+ itemsDa.Dispose();
+ itemsDa = null;
+ }
+ if(terrainDa != null) {
+ terrainDa.Dispose();
+ terrainDa = null;
+ }
+ if(landDa != null) {
+ landDa.Dispose();
+ landDa = null;
+ }
+ if(landAccessListDa != null) {
+ landAccessListDa.Dispose();
+ landAccessListDa = null;
+ }
+ if(regionSettingsDa != null) {
+ regionSettingsDa.Dispose();
+ regionSettingsDa = null;
+ }
+ }
+
public void StoreRegionSettings(RegionSettings rs)
{
lock (ds)
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs
index 2c1e3c3aa9..a238ebf750 100644
--- a/OpenSim/Data/SQLite/SQLiteUserData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserData.cs
@@ -122,7 +122,30 @@ namespace OpenSim.Data.SQLite
return;
}
- public override void Dispose () {}
+ public override void Dispose ()
+ {
+ if(g_conn != null) {
+ g_conn.Close();
+ g_conn = null;
+ }
+ if(ds != null) {
+ ds.Dispose();
+ ds = null;
+ }
+ if(da != null) {
+ da.Dispose();
+ da = null;
+ }
+ if(daf != null) {
+ daf.Dispose();
+ daf = null;
+ }
+ if(dua != null) {
+ dua.Dispose();
+ dua = null;
+ }
+ aplist = null;
+ }
///
/// see IUserDataPlugin,
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
index 5f10ec533d..0ee4933754 100644
--- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
+++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
@@ -41,6 +41,11 @@ namespace OpenSim.Region.Environment.Interfaces
/// a connection string for the database
void Initialise(string filename);
+ ///
+ /// Dispose the database
+ ///
+ void Dispose();
+
///
/// Stores all object's details apart from inventory
///