From c48069536922db4a227545fd915c37af141071e9 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 7 Aug 2013 19:40:05 +0000 Subject: [PATCH] Fix db_sql to not remove objects when shutting down, as some modules that unload before it when shutting down remove their items then --- modules/database/db_sql.cpp | 2 ++ modules/database/db_sql_live.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/modules/database/db_sql.cpp b/modules/database/db_sql.cpp index b575d3fd1..f6af798b4 100644 --- a/modules/database/db_sql.cpp +++ b/modules/database/db_sql.cpp @@ -197,6 +197,8 @@ class DBSQL : public Module, public Pipe void OnSerializableDestruct(Serializable *obj) anope_override { + if (this->shutting_down) + return; Serialize::Type *s_type = obj->GetSerializableType(); if (s_type && obj->id > 0) this->RunBackground("DELETE FROM `" + this->prefix + s_type->GetName() + "` WHERE `id` = " + stringify(obj->id)); diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp index 02e8a355f..7ef0528a8 100644 --- a/modules/database/db_sql_live.cpp +++ b/modules/database/db_sql_live.cpp @@ -126,6 +126,11 @@ class DBMySQL : public Module, public Pipe init = false; } + void OnRestart() anope_override + { + init = false; + } + void OnReload(Configuration::Conf *conf) anope_override { Configuration::Block *block = conf->GetModule(this);