From 69cfd36054e5ab755c8f19310e70b539a1b2a86b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 29 Oct 2009 00:07:15 -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 f7e8c383..74ddbf0e 100644 --- a/core/ConsoleDetours.cpp +++ b/core/ConsoleDetours.cpp @@ -151,7 +151,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