Fix for bug 76541, r=danm, sr=brendan, a=asa@mozilla.org. Suspending and Releasing JS requests during Alert and Confirm dialog creation.

This commit is contained in:
dbragg%netscape.com 2001-04-23 22:08:05 +00:00
Родитель bc2b832d37
Коммит f4f5b67ca5
2 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -2532,7 +2532,7 @@ nsInstall::Confirm(nsString& string, PRBool* aReturn)
PRUnichar *title = GetTranslatedString(NS_ConvertASCIItoUCS2("Confirm").get());
return dialog->Confirm(mParent, title, string.GetUnicode(), aReturn);
return proxiedDialog->Confirm(mParent, title, string.GetUnicode(), aReturn);
}

Просмотреть файл

@ -1631,7 +1631,13 @@ InstallAlert(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
// public int InstallAlert (String aComment);
ConvertJSValToStr(b0, cx, argv[0]);
jsrefcount saveDepth = JS_SuspendRequest(cx);//Need to suspend use of thread or deadlock occurs
nativeThis->Alert(b0);
JS_ResumeRequest(cx, saveDepth);
}
else
{
@ -1665,8 +1671,13 @@ InstallConfirm(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
// public int InstallConfirm (String aComment);
ConvertJSValToStr(b0, cx, argv[0]);
jsrefcount saveDepth = JS_SuspendRequest(cx);//Need to suspend use of thread or deadlock occurs
nativeThis->Confirm(b0, &nativeRet);
JS_ResumeRequest(cx, saveDepth);
*rval = INT_TO_JSVAL(nativeRet);
}
else