closed #3856: Crash when Firefox connects to JSB application.

This commit is contained in:
James Chen 2014-01-26 13:54:48 +08:00
parent 5b9f1697d3
commit 04f2cc48a2
1 changed files with 3 additions and 0 deletions

View File

@ -1408,6 +1408,9 @@ void ScriptingCore::enableDebugger()
JS_SetDebugMode(_cx, JS_TRUE);
_debugGlobal = NewGlobalObject(_cx, true);
// Adds the debugger object to root, otherwise it may be collected by GC.
JS_AddObjectRoot(_cx, &_debugGlobal);
JS_WrapObject(_cx, &_debugGlobal);
JSAutoCompartment ac(_cx, _debugGlobal);
// these are used in the debug program