From 13ade6fed1248d3bc54ea573da4962d5ddd21321 Mon Sep 17 00:00:00 2001 From: peavey Date: Sat, 30 Dec 2006 12:33:06 +0000 Subject: 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 --- src/modules/extra/m_mysql.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/modules') 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"); } -- cgit v1.2.3