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