mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 04:05:32 +00:00
Use StructuredClone in m_GuiMessageQueue
The elements have to be cloned either way. Now they don't have to be traced when they are in the queue.
This commit is contained in:
@@ -196,16 +196,14 @@ CStr GetPlayerGUID()
|
||||
return g_NetClient->GetGUID();
|
||||
}
|
||||
|
||||
JS::Value PollNetworkClient(const ScriptInterface& guiInterface)
|
||||
JS::Value PollNetworkClient(const ScriptRequest& rq)
|
||||
{
|
||||
if (!g_NetClient)
|
||||
return JS::UndefinedValue();
|
||||
|
||||
// Convert from net client context to GUI script context
|
||||
ScriptRequest rqNet(g_NetClient->GetScriptInterface());
|
||||
JS::RootedValue pollNet(rqNet.cx);
|
||||
g_NetClient->GuiPoll(&pollNet);
|
||||
return Script::CloneValueFromOtherCompartment(guiInterface, g_NetClient->GetScriptInterface(), pollNet);
|
||||
JS::RootedValue message{rq.cx};
|
||||
g_NetClient->GuiPoll(rq, &message);
|
||||
return message;
|
||||
}
|
||||
|
||||
void SendGameSetupMessage(const ScriptInterface& scriptInterface, JS::HandleValue attribs1)
|
||||
|
||||
Reference in New Issue
Block a user