diff options
| author | 2019-08-20 16:17:18 +0100 | |
|---|---|---|
| committer | 2019-08-20 16:19:01 +0100 | |
| commit | 8745660fcdac7c1b80c94cfc0ff60928cd4dd4b7 (patch) | |
| tree | e92bc6a0a62da27e9ea0395d48187606666b9676 /src/modules/extra/m_mysql.cpp | |
| parent | Fix some remaining uses of ato[il]. (diff) | |
| download | inspircd++-8745660fcdac7c1b80c94cfc0ff60928cd4dd4b7.tar.gz inspircd++-8745660fcdac7c1b80c94cfc0ff60928cd4dd4b7.tar.bz2 inspircd++-8745660fcdac7c1b80c94cfc0ff60928cd4dd4b7.zip | |
Initialise and deallocate the MySQL library correctly.
Diffstat (limited to 'src/modules/extra/m_mysql.cpp')
| -rw-r--r-- | src/modules/extra/m_mysql.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index c50d2abf5..7b6e2906d 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -412,6 +412,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); } @@ -424,10 +427,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::ReadConfig(ConfigStatus& status) |
