1.1 --- a/core/EventManager.cpp Fri May 09 23:17:14 2014 -0400
1.2 +++ b/core/EventManager.cpp Sat May 10 02:40:08 2014 -0700
1.3 @@ -209,7 +209,7 @@
1.4 }
1.5
1.6 /* Cache the name for post hooks */
1.7 - pHook->name = sm_strdup(name);
1.8 + pHook->name = name;
1.9
1.10 /* Increase reference count */
1.11 pHook->refCount++;
1.12 @@ -314,9 +314,6 @@
1.13 /* Delete entry in trie */
1.14 m_EventHooks.remove(name);
1.15
1.16 - /* Free the cached name */
1.17 - delete pHook->name;
1.18 -
1.19 /* And finally free structure memory */
1.20 delete pHook;
1.21 }
1.22 @@ -477,7 +474,7 @@
1.23 pForward->PushCell(BAD_HANDLE);
1.24 }
1.25
1.26 - pForward->PushString(pHook->name);
1.27 + pForward->PushString(pHook->name.chars());
1.28 pForward->PushCell(bDontBroadcast);
1.29 pForward->Execute(NULL);
1.30
1.31 @@ -498,8 +495,7 @@
1.32 {
1.33 assert(pHook->pPostHook == NULL);
1.34 assert(pHook->pPreHook == NULL);
1.35 - m_EventHooks.remove(pHook->name);
1.36 - delete pHook->name;
1.37 + m_EventHooks.remove(pHook->name.chars());
1.38 delete pHook;
1.39 }
1.40 }