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:
akhil.arora%sun.com 1999-10-15 01:47:04 +00:00
Родитель d91d37ae36
Коммит 8413fee16d
1 изменённых файлов: 12 добавлений и 1 удалений

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

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