From 20bf4e0a20cb42f02f361bd955dad9516b4201b9 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 22 Apr 2005 15:10:40 +0000 Subject: Fixed crash-n-burn on rehash git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1163 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_sql.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/modules/extra/m_sql.cpp b/src/modules/extra/m_sql.cpp index 2148ec3de..5aee87a70 100644 --- a/src/modules/extra/m_sql.cpp +++ b/src/modules/extra/m_sql.cpp @@ -159,10 +159,6 @@ class SQLConnection return Enabled; } - ~SQLConnection() - { - mysql_close(&connection); - } }; typedef std::vector ConnectionList; @@ -195,6 +191,7 @@ class ModuleSQL : public Module { Srv->Log(DEFAULT,"SQL: Loading database settings"); Connections.clear(); + Srv->Log(DEBUG,"Cleared connections"); for (int j =0; j < Conf->Enumerate("database"); j++) { std::string db = Conf->ReadValue("database","name",j); @@ -202,11 +199,13 @@ class ModuleSQL : public Module std::string pass = Conf->ReadValue("database","password",j); std::string host = Conf->ReadValue("database","hostname",j); std::string id = Conf->ReadValue("database","id",j); + Srv->Log(DEBUG,"Read database settings"); if ((db != "") && (host != "") && (user != "") && (id != "") && (pass != "")) { SQLConnection ThisSQL(host,user,pass,db,atoi(id.c_str())); Srv->Log(DEFAULT,"Loaded database: "+ThisSQL.GetHost()); Connections.push_back(ThisSQL); + Srv->Log(DEBUG,"Pushed back connection"); } } ConnectDatabases(); -- cgit v1.2.3