forked from mirrors/0ad
Encapsulate runtime creation.
- Makes it easier to change down the line (and change is coming) - Allows making g_ScriptRuntime thread-local easily. - Remove ParentRuntime, which is not used at the moment. Part of the SM52 migration, stage: SM45 compatible. Patch by: Itms Tested By: Freagarach Refs #4893 Differential Revision: https://code.wildfiregames.com/D3087 This was SVN commit r24171.
This commit is contained in:
@@ -388,7 +388,8 @@ void CNetServerWorker::Run()
|
||||
|
||||
// To avoid the need for JS_SetContextThread, we create and use and destroy
|
||||
// the script interface entirely within this network thread
|
||||
m_ScriptInterface = new ScriptInterface("Engine", "Net server", ScriptInterface::CreateRuntime(g_ScriptRuntime));
|
||||
shared_ptr<ScriptRuntime> netServerRuntime = ScriptRuntime::CreateRuntime();
|
||||
m_ScriptInterface = new ScriptInterface("Engine", "Net server", netServerRuntime);
|
||||
m_GameAttributes.init(m_ScriptInterface->GetJSRuntime(), JS::UndefinedValue());
|
||||
|
||||
while (true)
|
||||
|
||||
Reference in New Issue
Block a user