From 5111b4799c82b1b90f76fe705bde29d2a9422d5d Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 29 Oct 2009 00:06:12 -0700 Subject: [PATCH] Fix iloop race when using AddCommandListener and SourceMod unloads (bug 4077, r=pred). --- core/ConsoleDetours.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/ConsoleDetours.cpp b/core/ConsoleDetours.cpp index c52fe122..ce1722ea 100644 --- a/core/ConsoleDetours.cpp +++ b/core/ConsoleDetours.cpp @@ -156,7 +156,10 @@ class GenericCommandHooker : public IConCommandLinkListener while (iter != vtables.end()) { if ((*iter).refcount) + { + iter++; continue; + } /* Damn it. This event happens AFTER the plugin has unloaded! * There's two options. Remove the hook now and hope SH's memory * protection will prevent a crash. Otherwise, we can wait until