mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-28 11:12:37 +00:00
Fixes a crash introduced in fd187f466f by ensuring that the CScriptValRooted values are destroyed before calling JS_DestroyContext.
I've tested the performance on Combat Demo (Huge) again with the code from #2394. It's very close but probably a little bit lower (hard to tell because it's so close). Closes #2408 Refs #2394 This was SVN commit r14705.
This commit is contained in:
@@ -91,8 +91,6 @@ public:
|
||||
*/
|
||||
static shared_ptr<ScriptRuntime> CreateRuntime(int runtimeSize = DEFAULT_RUNTIME_SIZE);
|
||||
|
||||
CScriptValRooted vector2Dprototype;
|
||||
CScriptValRooted vector3Dprototype;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -130,6 +128,9 @@ public:
|
||||
*/
|
||||
bool LoadGlobalScripts();
|
||||
|
||||
enum CACHED_VAL { CACHE_VECTOR2DPROTO, CACHE_VECTOR3DPROTO };
|
||||
CScriptValRooted GetCachedValue(CACHED_VAL valueIdentifier);
|
||||
|
||||
/**
|
||||
* Replace the default JS random number geenrator with a seeded, network-sync'd one.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user