diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/account.cpp | 14 | ||||
-rw-r--r-- | src/bots.cpp | 2 | ||||
-rw-r--r-- | src/channels.cpp | 5 | ||||
-rw-r--r-- | src/extensible.cpp | 5 | ||||
-rw-r--r-- | src/module.cpp | 2 | ||||
-rw-r--r-- | src/nickalias.cpp | 2 | ||||
-rw-r--r-- | src/nickcore.cpp | 2 | ||||
-rw-r--r-- | src/regchannel.cpp | 2 | ||||
-rw-r--r-- | src/users.cpp | 2 |
9 files changed, 34 insertions, 2 deletions
diff --git a/src/account.cpp b/src/account.cpp index e58ee1646..89c9c7909 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -73,8 +73,20 @@ void IdentifyRequest::ModuleUnload(Module *m) IdentifyRequest *ir = *it; ++it; - ir->Release(m); + ir->holds.erase(m); + if (ir->holds.empty() && ir->dispatched) + { + if (!ir->success) + ir->OnFail(); + delete ir; + continue; + } + if (ir->owner == m) + { + if (!ir->success) + ir->OnFail(); delete ir; + } } } diff --git a/src/bots.cpp b/src/bots.cpp index 85e605f21..c6a726855 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -49,6 +49,8 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A BotInfo::~BotInfo() { + UnsetExtensibles(); + FOREACH_MOD(OnDelBot, (this)); // If we're synchronised with the uplink already, send the bot. diff --git a/src/channels.cpp b/src/channels.cpp index 7e7702d7e..18a85ab49 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -52,6 +52,8 @@ Channel::Channel(const Anope::string &nname, time_t ts) Channel::~Channel() { + UnsetExtensibles(); + FOREACH_MOD(OnChannelDelete, (this)); ModeManager::StackerDel(this); @@ -856,7 +858,8 @@ void Channel::SetCorrectModes(User *user, bool give_modes) given = true; } } - else if (take_modes && !has_priv && !u_access.HasPriv(cm->name + "ME")) + /* modes that have no privileges assigned shouldn't be removed (like operprefix, ojoin) */ + else if (take_modes && !has_priv && ci->GetLevel(cm->name + "ME") != ACCESS_INVALID && !u_access.HasPriv(cm->name + "ME")) { /* Only remove modes if they are > voice */ if (cm->name == "VOICE") diff --git a/src/extensible.cpp b/src/extensible.cpp index 37206f7c1..50a23101a 100644 --- a/src/extensible.cpp +++ b/src/extensible.cpp @@ -24,6 +24,11 @@ ExtensibleBase::~ExtensibleBase() Extensible::~Extensible() { + UnsetExtensibles(); +} + +void Extensible::UnsetExtensibles() +{ while (!extension_items.empty()) (*extension_items.begin())->Unset(this); } diff --git a/src/module.cpp b/src/module.cpp index 3266c955f..5c02e4e49 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -64,6 +64,8 @@ Module::Module(const Anope::string &modname, const Anope::string &, ModType modt Module::~Module() { + UnsetExtensibles(); + /* Detach all event hooks for this module */ ModuleManager::DetachAll(this); IdentifyRequest::ModuleUnload(this); diff --git a/src/nickalias.cpp b/src/nickalias.cpp index 9f3651c12..fbf3411fc 100644 --- a/src/nickalias.cpp +++ b/src/nickalias.cpp @@ -51,6 +51,8 @@ NickAlias::NickAlias(const Anope::string &nickname, NickCore* nickcore) : Serial NickAlias::~NickAlias() { + UnsetExtensibles(); + FOREACH_MOD(OnDelNick, (this)); /* Accept nicks that have no core, because of database load functions */ diff --git a/src/nickcore.cpp b/src/nickcore.cpp index 9c0e25f32..f669a9181 100644 --- a/src/nickcore.cpp +++ b/src/nickcore.cpp @@ -38,6 +38,8 @@ NickCore::NickCore(const Anope::string &coredisplay) : Serializable("NickCore"), NickCore::~NickCore() { + UnsetExtensibles(); + FOREACH_MOD(OnDelCore, (this)); if (!this->chanaccess->empty()) diff --git a/src/regchannel.cpp b/src/regchannel.cpp index 397a6f28b..2b17c72ca 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -142,6 +142,8 @@ ChannelInfo::ChannelInfo(const ChannelInfo &ci) : Serializable("ChannelInfo"), ChannelInfo::~ChannelInfo() { + UnsetExtensibles(); + FOREACH_MOD(OnDelChan, (this)); Log(LOG_DEBUG) << "Deleting channel " << this->name; diff --git a/src/users.cpp b/src/users.cpp index 8ec13d8c0..73d1d4368 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -292,6 +292,8 @@ void User::SetRealname(const Anope::string &srealname) User::~User() { + UnsetExtensibles(); + if (this->server != NULL) { if (this->server->IsSynced()) |