From 5415033d4ab3ecc99962e40b61ac05411d6fd4fa Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Thu, 20 Jul 2006 10:53:06 +0000 Subject: [PATCH] Crash bug, I squash you. Fixed bug where returning false in Load() after adding a Metamod event listener or hooking a function could cause a crash. --HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40233 --- sourcemm/CPlugin.cpp | 4 ++++ sourcemm/changelog.txt | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sourcemm/CPlugin.cpp b/sourcemm/CPlugin.cpp index db1d871..8e88a9d 100644 --- a/sourcemm/CPlugin.cpp +++ b/sourcemm/CPlugin.cpp @@ -384,6 +384,10 @@ CPluginManager::CPlugin *CPluginManager::_Load(const char *file, PluginId source if (pl->m_Lib && (pl->m_Status < Pl_Paused)) { + pl->m_Events.clear(); + g_SourceHook.UnloadPlugin(pl->m_Id); + UnregAllConCmds(pl); + dlclose(pl->m_Lib); pl->m_Lib = NULL; pl->m_API = NULL; diff --git a/sourcemm/changelog.txt b/sourcemm/changelog.txt index 244513d..0dff6ed 100644 --- a/sourcemm/changelog.txt +++ b/sourcemm/changelog.txt @@ -4,6 +4,8 @@ - Fixed bug where Metamod:Source could load the wrong GameDLL and/or load more than one GameDLL. This issue occured in HL2 CTF, SourceForts, or any other mod that relied on files from another mod directory. + - Fixed bug where returning false in Load() after adding a Metamod event listener or + hooking a function could cause a crash. 2006/06/14 1.2.3: - Added SourceHook API for manual recalls: RETURN_META_(VALUE_)MNEWPARAMS