From 7336f449ebaa068703e1caa7d8b1b7a9993b651f Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 11 Nov 2007 12:41:03 +0000 Subject: Fix crashes from badly written safeiters git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8563 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/modules.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/modules.h b/include/modules.h index 51f1630d4..5190563ef 100644 --- a/include/modules.h +++ b/include/modules.h @@ -125,10 +125,10 @@ typedef std::map > interfacelist; */ #define FOREACH_MOD(y,x) do { \ EventHandlerIter safei; \ - for (EventHandlerIter _i = ServerInstance->Modules->EventHandlers[y].begin(); _i != ServerInstance->Modules->EventHandlers[y].end(); ++_i) \ + for (EventHandlerIter _i = ServerInstance->Modules->EventHandlers[y].begin(); _i != ServerInstance->Modules->EventHandlers[y].end(); ) \ { \ safei = _i; \ - safei++; \ + ++safei; \ try \ { \ (*_i)->x ; \ @@ -149,10 +149,10 @@ typedef std::map > interfacelist; */ #define FOREACH_MOD_I(z,y,x) do { \ EventHandlerIter safei; \ - for (EventHandlerIter _i = z->Modules->EventHandlers[y].begin(); _i != z->Modules->EventHandlers[y].end(); ++_i) \ + for (EventHandlerIter _i = z->Modules->EventHandlers[y].begin(); _i != z->Modules->EventHandlers[y].end(); ) \ { \ safei = _i; \ - safei++; \ + ++safei; \ try \ { \ (*_i)->x ; \ @@ -174,10 +174,10 @@ typedef std::map > interfacelist; do { \ EventHandlerIter safei; \ MOD_RESULT = 0; \ - for (EventHandlerIter _i = ServerInstance->Modules->EventHandlers[y].begin(); _i != ServerInstance->Modules->EventHandlers[y].end(); ++_i) \ + for (EventHandlerIter _i = ServerInstance->Modules->EventHandlers[y].begin(); _i != ServerInstance->Modules->EventHandlers[y].end(); ) \ { \ safei = _i; \ - safei++; \ + ++safei; \ try \ { \ int res = (*_i)->x ; \ @@ -204,10 +204,10 @@ do { \ do { \ EventHandlerIter safei; \ MOD_RESULT = 0; \ - for (EventHandlerIter _i = z->Modules->EventHandlers[y].begin(); _i != z->Modules->EventHandlers[y].end(); ++_i) \ + for (EventHandlerIter _i = z->Modules->EventHandlers[y].begin(); _i != z->Modules->EventHandlers[y].end(); ) \ { \ safei = _i; \ - safei++; \ + ++safei; \ try \ { \ int res = (*_i)->x ; \ -- cgit v1.2.3