Merge pull request #5227 from dumganhar/iss3856-remote-debug-crash-mac

closed #3856: Crash when Firefox connects to JSB application.
This commit is contained in:
James Chen 2014-01-25 21:55:34 -08:00
commit 6f45d9ca27
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