The patch in 4b65f77438 seems to have fixed the crash, but the initData value doesn't match the JSContext's compartment, so it's theoretically wrong.

This should fix it correctly.

#Refs 2241

This was SVN commit r14508.
This commit is contained in:
Yves
2014-01-04 21:49:36 +00:00
parent 4b65f77438
commit 6ca6a5f779
+5 -3
View File
@@ -86,10 +86,12 @@ namespace {
// Note that the initData argument may only contain clonable data.
// Functions aren't supported for example!
// TODO: Use LOGERROR to print a friendly error message when the requirements aren't met instead of failing with debug_warn when cloning.
void PushGuiPage(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), std::wstring name, CScriptVal initData)
void PushGuiPage(ScriptInterface::CxPrivate* pCxPrivate, std::wstring name, CScriptVal initData)
{
// TODO: we currently use the ScriptInterface of g_GUI. Check the comment in CGUIManager::SwitchPage for a detailed explanation.
g_GUI->PushPage(name, g_GUI->GetScriptInterface()->WriteStructuredClone(initData.get()));
// TODO: Check the comment in CGUIManager::SwitchPage for a detailed explanation of this hack.
CScriptVal cloneSaveInitData;
cloneSaveInitData = g_GUI->GetScriptInterface()->CloneValueFromOtherContext(*(pCxPrivate->pScriptInterface), initData.get());
g_GUI->PushPage(name, g_GUI->GetScriptInterface()->WriteStructuredClone(cloneSaveInitData.get()));
}
void SwitchGuiPage(ScriptInterface::CxPrivate* pCxPrivate, std::wstring name, CScriptVal initData)