зеркало из https://github.com/mozilla/pjs.git
16426 r=akhil.arora@sun.com fixed by Denis Sharypov <sdv@sparc.spb.su>
The class java.lang.RuntimeException was not being pinned
This commit is contained in:
Родитель
d91d37ae36
Коммит
8413fee16d
|
@ -228,6 +228,8 @@ void JavaDOMGlobals::Initialize(JNIEnv *env)
|
|||
|
||||
runtimeExceptionClass = env->FindClass("java/lang/RuntimeException");
|
||||
if (!runtimeExceptionClass) return;
|
||||
runtimeExceptionClass = (jclass) env->NewGlobalRef(runtimeExceptionClass);
|
||||
if (!runtimeExceptionClass) return;
|
||||
|
||||
runtimeExceptionInitMID =
|
||||
env->GetMethodID(runtimeExceptionClass, "<init>", "(Ljava/lang/String;)V");
|
||||
|
@ -389,6 +391,15 @@ void JavaDOMGlobals::Destroy(JNIEnv *env)
|
|||
}
|
||||
domExceptionClass = NULL;
|
||||
|
||||
env->DeleteGlobalRef(runtimeExceptionClass);
|
||||
if (env->ExceptionOccurred()) {
|
||||
PR_LOG(log, PR_LOG_ERROR,
|
||||
("JavaDOMGlobals::Destroy: failed to delete DOM Exception global ref %x\n",
|
||||
runtimeExceptionClass));
|
||||
return;
|
||||
}
|
||||
runtimeExceptionClass = NULL;
|
||||
|
||||
TakeOutGarbage();
|
||||
PR_DestroyLock(garbageLock);
|
||||
}
|
||||
|
@ -552,7 +563,7 @@ void JavaDOMGlobals::ThrowException(JNIEnv *env,
|
|||
|
||||
jstring jmessage = env->NewStringUTF(msg);
|
||||
|
||||
jthrowable newException =
|
||||
newException =
|
||||
(jthrowable)env->NewObject(runtimeExceptionClass,
|
||||
runtimeExceptionInitMID,
|
||||
jmessage);
|
||||
|
|
Загрузка…
Ссылка в новой задаче