]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_mysql.cpp
That should make it load/unload, still needs REHASH done proper.
[user/henk/code/inspircd.git] / src / modules / extra / m_mysql.cpp
index 19632d669b23d66a9f5a89babfe20962ef429e49..cebacde276320d676540ba296cb68db18a421586 100644 (file)
@@ -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");
        }