From f82cc8dd39fe97a9e91226b2aa892dcf036a5c0c Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 8 Aug 2006 12:22:21 +0000 Subject: chanrec::KickUser and chanrec::ServerKickUser return number of users left on the channel after the kick. If either returns 0, you should delete the chanrec immediately after return: if (!c->KickUser(mysrc, mydest, "DIE")) /* arse */ delete c; git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4783 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 51c68aeff..d3f8e9a21 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -2896,7 +2896,9 @@ class TreeSocket : public InspSocket chanrec* chan = Srv->FindChannel(params[0]); if (user && chan) { - chan->ServerKickUser(user, params[2].c_str(), false); + if (!chan->ServerKickUser(user, params[2].c_str(), false)) + /* Yikes, the channels gone! */ + delete chan; } } if (this->InboundServerName != "") -- cgit v1.2.3