summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-30 12:33:06 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-30 12:33:06 +0000
commit13ade6fed1248d3bc54ea573da4962d5ddd21321 (patch)
tree57c25406cd8e80aa052f90ad4e5ebef8819a4453 /src/modules
parent35c93cd6a5ab9813087da3f63b67b908e65ae73a (diff)
That should make it load/unload, still needs REHASH done proper.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6167 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_mysql.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index 19632d669..cebacde27 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -411,6 +411,11 @@ class SQLConnection : public classbase
{
}
+ ~SQLConnection()
+ {
+ Close();
+ }
+
// This method connects to the database using the credentials supplied to the constructor, and returns
// true upon success.
bool Connect()
@@ -574,6 +579,11 @@ class SQLConnection : public classbase
return Enabled;
}
+ void Close()
+ {
+ mysql_close(&connection);
+ }
+
};
ConnMap Connections;
@@ -600,7 +610,7 @@ void ClearDatabases()
while ((i = Connections.begin()) != Connections.end())
{
Connections.erase(i);
- delete i->second;
+ DELETE(i->second);
}
}
@@ -762,6 +772,7 @@ class ModuleSQL : public Module
ClearDatabases();
DELETE(Conf);
ServerInstance->UnpublishInterface("SQL", this);
+ ServerInstance->UnpublishFeature("SQL");
ServerInstance->DoneWithInterface("SQLutils");
}