diff options
| author | Adam <Adam@anope.org> | 2014-03-04 04:14:17 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2014-03-04 04:15:32 -0500 |
| commit | 09bec79b473fad40268f7b25b92c4979563829c4 (patch) | |
| tree | e5e70c2fd3c6bfbcdb3fbd571c3c0191741b3caa /modules | |
| parent | 55a5affcb8251c6ef677d78ea848dc8d26b90471 (diff) | |
Fix 2 crashes from removing the permanent channel mode from channels which do not exist
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/commands/cs_mode.cpp | 4 | ||||
| -rw-r--r-- | modules/commands/cs_set.cpp | 6 | ||||
| -rw-r--r-- | modules/pseudoclients/chanserv.cpp | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index db5eecbb3..a13610d23 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -902,9 +902,9 @@ class CSMode : public Module } } - void OnCheckModes(Channel *c) anope_override + void OnCheckModes(Reference<Channel> &c) anope_override { - if (!c->ci) + if (!c || !c->ci) return; ModeLocks *locks = modelocks.Get(c->ci); diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index bb8232808..1109c888e 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -1289,12 +1289,6 @@ class CSSet : public Module { if (c->ci) persist.Unset(c->ci); - - if (c->CheckDelete()) - { - delete c; - return EVENT_STOP; - } } if (c->ci && mode->type != MODE_STATUS && !c->syncing && Me->IsSynced()) diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index 388a14649..250296f55 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -274,8 +274,11 @@ class ChanServCore : public Module, public ChanServService "lists and settings for any channel.")); } - void OnCheckModes(Channel *c) anope_override + void OnCheckModes(Reference<Channel> &c) anope_override { + if (!c) + return; + if (c->ci) c->SetMode(c->ci->WhoSends(), "REGISTERED", "", false); else |
