aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/extra/m_mysql.cpp
diff options
context:
space:
mode:
authorGravatar Peter Powell2019-08-20 16:17:18 +0100
committerGravatar Peter Powell2019-08-20 16:48:09 +0100
commit2cc35d8625b7ea5cbd1d1ebb116aff86c5280162 (patch)
tree3c99d65076fd6b0babde4f5fc7f0125ebe49fa78 /src/modules/extra/m_mysql.cpp
parentUpdate modulemanager for inspircd-contrib. (diff)
Initialise and deallocate the MySQL library correctly.
Diffstat (limited to 'src/modules/extra/m_mysql.cpp')
-rw-r--r--src/modules/extra/m_mysql.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index 159a0b8b2..e268505d9 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -380,6 +380,9 @@ ModuleSQL::ModuleSQL()
void ModuleSQL::init()
{
+ if (mysql_library_init(0, NULL, NULL))
+ throw ModuleException("Unable to initialise the MySQL library!");
+
Dispatcher = new DispatcherThread(this);
ServerInstance->Threads->Start(Dispatcher);
@@ -397,10 +400,13 @@ ModuleSQL::~ModuleSQL()
Dispatcher->OnNotify();
delete Dispatcher;
}
+
for(ConnMap::iterator i = connections.begin(); i != connections.end(); i++)
{
delete i->second;
}
+
+ mysql_library_end();
}
void ModuleSQL::OnRehash(User* user)