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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user