mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
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:
parent
fb9ab8d4ae
commit
e6c5833e3f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user