1
0
forked from mirrors/0ad

Fixes crash when loading maps in Atlas.

The ScriptInterface pointer can be NULL there, so using it without
checking is not safe.
This fixes the problem by continuing with the exact stack rooting
changes, which makes the temporary solution unnecessary.

Fixes #2707
Refs #2415

This was SVN commit r15611.
This commit is contained in:
Yves
2014-08-04 20:14:17 +00:00
parent 30fa275f9d
commit e41f010f91
5 changed files with 15 additions and 15 deletions
+6 -1
View File
@@ -96,8 +96,13 @@ void PushGuiPage(ScriptInterface::CxPrivate* pCxPrivate, std::wstring name, CScr
g_GUI->PushPage(name, pCxPrivate->pScriptInterface->WriteStructuredClone(initData));
}
void SwitchGuiPage(ScriptInterface::CxPrivate* pCxPrivate, std::wstring name, CScriptVal initData)
void SwitchGuiPage(ScriptInterface::CxPrivate* pCxPrivate, std::wstring name, CScriptVal initData1)
{
JSContext* cx = pCxPrivate->pScriptInterface->GetContext();
JSAutoRequest rq(cx);
// TODO: Get Handle parameter directly with SpiderMonkey 31
JS::RootedValue initData(cx, initData1.get());
g_GUI->SwitchPage(name, pCxPrivate->pScriptInterface, initData);
}