Fixed a memory leak when game events were hooked as EventHookMode_Post (no bug, r=me).

The duplicated event data that was being carried over to the IGameEventManager2::FireEvent post hook was not being freed. EventHookMode_Post is the default so this leak could have happened fairly often.
This commit is contained in:
Scott Ehlert 2009-01-27 13:41:57 -06:00
parent c676ecc026
commit 157f050f89

View File

@ -424,10 +424,11 @@ bool EventManager::OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast)
if (sm_trie_retrieve(m_EventHooks, name, reinterpret_cast<void **>(&pHook)))
{
pForward = pHook->pPostHook;
pEventCopy = pHook->pEventCopy;
if (pForward)
{
EventInfo info = { pHook->pEventCopy, NULL };
EventInfo info = { pEventCopy, NULL };
if (pHook->postCopy)
{