diff --git a/amxmodx/CTask.cpp b/amxmodx/CTask.cpp index 79abe7d4..afad6a0b 100755 --- a/amxmodx/CTask.cpp +++ b/amxmodx/CTask.cpp @@ -73,6 +73,11 @@ void CTaskMngr::CTask::set(CPluginMngr::CPlugin *pPlugin, int iFunc, int iFlags, void CTaskMngr::CTask::clear() { + if (m_iFunc >= 0) + { + unregisterSPForward(m_iFunc); + m_iFunc = -1; + } m_bFree = true; if (m_pParams) { @@ -133,7 +138,7 @@ void CTaskMngr::CTask::executeIfRequired(float fCurrentTime, float fTimeLimit, f else { unregisterSPForward(m_iFunc); - m_iFunc = 0; + m_iFunc = -1; m_bFree = true; } } diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index 142c84d1..3497e3d9 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -444,13 +444,13 @@ void C_ServerDeactivate_Post() { detachReloadModules(); g_auth.clear(); - g_forwards.clear(); g_commands.clear(); g_forcemodels.clear(); g_forcesounds.clear(); g_forcegeneric.clear(); g_grenades.clear(); g_tasksMngr.clear(); + g_forwards.clear(); g_logevents.clearLogEvents(); g_events.clearEvents(); g_menucmds.clear(); @@ -460,7 +460,6 @@ void C_ServerDeactivate_Post() { g_langMngr.Save(build_pathname("%s/languages.dat", get_localinfo("amxx_datadir", "addons/amxmodx/data"))); g_langMngr.SaveCache(build_pathname("%s/dictionary.cache", get_localinfo("amxx_datadir", "addons/amxmodx/data"))); g_langMngr.Clear(); - //clear module name cache while (!CurModuleList.empty()) {