зеркало из https://github.com/mozilla/gecko-dev.git
Bug 440982 To avoid calling JS at unsafe times from JS_GC, jsds_ScriptHookProc should not get the script hook unless it needs to and it is safe to call
r=brendan sr=brendan
This commit is contained in:
Родитель
ec1bc87655
Коммит
99deca10be
|
@ -707,10 +707,10 @@ jsds_ScriptHookProc (JSDContext* jsdc, JSDScript* jsdscript, JSBool creating,
|
|||
JSRuntime *rt = JS_GetRuntime(cx);
|
||||
#endif
|
||||
|
||||
nsCOMPtr<jsdIScriptHook> hook;
|
||||
gJsds->GetScriptHook (getter_AddRefs(hook));
|
||||
|
||||
if (creating) {
|
||||
nsCOMPtr<jsdIScriptHook> hook;
|
||||
gJsds->GetScriptHook(getter_AddRefs(hook));
|
||||
|
||||
/* a script is being created */
|
||||
if (!hook) {
|
||||
/* nobody cares, just exit */
|
||||
|
@ -736,12 +736,15 @@ jsds_ScriptHookProc (JSDContext* jsdc, JSDScript* jsdscript, JSBool creating,
|
|||
static_cast<jsdIScript *>(JSD_GetScriptPrivate(jsdscript));
|
||||
if (!jsdis)
|
||||
return;
|
||||
|
||||
|
||||
jsdis->Invalidate();
|
||||
if (!hook)
|
||||
return;
|
||||
|
||||
|
||||
if (gGCStatus == JSGC_END) {
|
||||
nsCOMPtr<jsdIScriptHook> hook;
|
||||
gJsds->GetScriptHook(getter_AddRefs(hook));
|
||||
if (!hook)
|
||||
return;
|
||||
|
||||
/* if GC *isn't* running, we can tell the user about the script
|
||||
* delete now. */
|
||||
#ifdef CAUTIOUS_SCRIPTHOOK
|
||||
|
|
Загрузка…
Ссылка в новой задаче