Exact stack rooting for JSON related ScriptInterface functions.

Refs #2415
Refs #2462

This was SVN commit r15603.
This commit is contained in:
Yves
2014-08-02 22:21:50 +00:00
parent 15fa9e2c2e
commit a2bd44b23a
25 changed files with 151 additions and 79 deletions
+6 -2
View File
@@ -298,11 +298,15 @@ void SaveGamePrefix(ScriptInterface::CxPrivate* pCxPrivate, std::wstring prefix,
LOGERROR(L"Failed to save game");
}
void SetNetworkGameAttributes(ScriptInterface::CxPrivate* pCxPrivate, CScriptVal attribs)
void SetNetworkGameAttributes(ScriptInterface::CxPrivate* pCxPrivate, CScriptVal attribs1)
{
ENSURE(g_NetServer);
// TODO: Get Handle parameter directly with SpiderMonkey 31
JSContext* cx = pCxPrivate->pScriptInterface->GetContext();
JSAutoRequest rq(cx);
JS::RootedValue attribs(cx, attribs1.get());
g_NetServer->UpdateGameAttributes(attribs, *(pCxPrivate->pScriptInterface));
g_NetServer->UpdateGameAttributes(&attribs, *(pCxPrivate->pScriptInterface));
}
void StartNetworkHost(ScriptInterface::CxPrivate* pCxPrivate, std::wstring playerName)