Fixed crasher bug.

Now PlugletEngine do not crache mozilla
in  case of missing jvm


git-svn-id: svn://10.0.0.236/trunk@60166 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
idk%eng.sun.com
2000-02-09 00:34:54 +00:00
parent 1cc83d0375
commit 818eb6a8db
3 changed files with 18 additions and 9 deletions

View File

@@ -49,6 +49,9 @@ void PlugletLoader::Initialize(void) {
("PlugletLoader::Initialize\n"));
//nb erors handling
JNIEnv * env = PlugletEngine::GetJNIEnv();
if (!env) {
return;
}
clazz = env->FindClass("org/mozilla/pluglet/PlugletLoader");
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
@@ -75,7 +78,9 @@ void PlugletLoader::Destroy(void) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("PlugletLoader::destroy\n"));
JNIEnv * env = PlugletEngine::GetJNIEnv();
env->DeleteGlobalRef(clazz);
if (env) {
env->DeleteGlobalRef(clazz);
}
}
char * PlugletLoader::GetMIMEDescription(const char * path) {