From 451a6d8464bd45a5477d0db62150d8762312e0b1 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Mon, 25 Jul 2005 19:09:49 +0000 Subject: [PATCH] PM STRIKES AGAIN (untested) --- amxmodx/CTask.cpp | 8 ++++++++ amxmodx/CTask.h | 1 + 2 files changed, 9 insertions(+) diff --git a/amxmodx/CTask.cpp b/amxmodx/CTask.cpp index 442dc86c..ccdd48dd 100755 --- a/amxmodx/CTask.cpp +++ b/amxmodx/CTask.cpp @@ -162,6 +162,11 @@ CTaskMngr::CTaskMngr() m_pTmr_TimeLeft = NULL; } +CTaskMngr::~CTaskMngr() +{ + clear(); +} + void CTaskMngr::registerTimers(float *pCurrentTime, float *pTimeLimit, float *pTimeLeft) { m_pTmr_CurrentTime = pCurrentTime; @@ -235,5 +240,8 @@ void CTaskMngr::startFrame() void CTaskMngr::clear() { + for (TaskListIter iter = m_Tasks.begin(); iter; ++iter) + delete &(*iter); // hamster + m_Tasks.clear(); } diff --git a/amxmodx/CTask.h b/amxmodx/CTask.h index fa87b0fc..94d59a10 100755 --- a/amxmodx/CTask.h +++ b/amxmodx/CTask.h @@ -106,6 +106,7 @@ private: float *m_pTmr_TimeLeft; public: CTaskMngr(); + ~CTaskMngr(); void registerTimers(float *pCurrentTime, float *pTimeLimit, float *pTimeLeft); // The timers will always point to the right value void registerTask(CPluginMngr::CPlugin *pPlugin, int iFunc, int iFlags, int iId, float fBase, int iParamsLen, const cell *pParams, int iRepeat);