mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 02:46:49 +00:00
Fix 4f972bc623
Shouldn't make last-minute changes without recompiling... This was SVN commit r25435.
This commit is contained in:
@@ -62,7 +62,7 @@ IGUIObject::IGUIObject(CGUI& pGUI)
|
||||
IGUIObject::~IGUIObject()
|
||||
{
|
||||
if (!m_ScriptHandlers.empty())
|
||||
JS_RemoveExtraGCRootsTracer(m_pGUI.GetScriptInterface().cx, Trace, this);
|
||||
JS_RemoveExtraGCRootsTracer(ScriptRequest(m_pGUI.GetScriptInterface()).cx, Trace, this);
|
||||
|
||||
// m_Children is deleted along all other GUI Objects in the CGUI destructor
|
||||
}
|
||||
@@ -310,7 +310,7 @@ void IGUIObject::RegisterScriptHandler(const CStr& eventName, const CStr& Code,
|
||||
void IGUIObject::SetScriptHandler(const CStr& eventName, JS::HandleObject Function)
|
||||
{
|
||||
if (m_ScriptHandlers.empty())
|
||||
JS_AddExtraGCRootsTracer(m_pGUI.GetScriptInterface().cx, Trace, this);
|
||||
JS_AddExtraGCRootsTracer(ScriptRequest(m_pGUI.GetScriptInterface()).cx, Trace, this);
|
||||
|
||||
m_ScriptHandlers[eventName] = JS::Heap<JSObject*>(Function);
|
||||
|
||||
@@ -328,7 +328,7 @@ void IGUIObject::UnsetScriptHandler(const CStr& eventName)
|
||||
m_ScriptHandlers.erase(it);
|
||||
|
||||
if (m_ScriptHandlers.empty())
|
||||
JS_RemoveExtraGCRootsTracer(m_pGUI.GetScriptInterface().cx, Trace, this);
|
||||
JS_RemoveExtraGCRootsTracer(ScriptRequest(m_pGUI.GetScriptInterface()).cx, Trace, this);
|
||||
|
||||
std::unordered_map<CStr, std::vector<IGUIObject*>>::iterator it2 = m_pGUI.m_EventObjects.find(eventName);
|
||||
if (it2 == m_pGUI.m_EventObjects.end())
|
||||
|
||||
Reference in New Issue
Block a user