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:
Yves
2014-01-30 13:21:36 +00:00
parent b9eea330d0
commit bab3a08643
3 changed files with 19 additions and 6 deletions
+3 -2
View File
@@ -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.
*/