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:
parent
c676ecc026
commit
157f050f89
@ -424,10 +424,11 @@ bool EventManager::OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast)
|
|||||||
if (sm_trie_retrieve(m_EventHooks, name, reinterpret_cast<void **>(&pHook)))
|
if (sm_trie_retrieve(m_EventHooks, name, reinterpret_cast<void **>(&pHook)))
|
||||||
{
|
{
|
||||||
pForward = pHook->pPostHook;
|
pForward = pHook->pPostHook;
|
||||||
|
pEventCopy = pHook->pEventCopy;
|
||||||
|
|
||||||
if (pForward)
|
if (pForward)
|
||||||
{
|
{
|
||||||
EventInfo info = { pHook->pEventCopy, NULL };
|
EventInfo info = { pEventCopy, NULL };
|
||||||
|
|
||||||
if (pHook->postCopy)
|
if (pHook->postCopy)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user