The class java.lang.RuntimeException was not being pinned


git-svn-id: svn://10.0.0.236/trunk@50760 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
akhil.arora%sun.com
1999-10-15 01:47:04 +00:00
parent 4e04c99aad
commit 047329ce0a

View File

@@ -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);