Fix for directors and non jvm created threads - the jvm would not close

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9245 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-08-11 22:41:12 +00:00
commit e4a580f4f3
2 changed files with 23 additions and 13 deletions

View file

@ -3155,7 +3155,8 @@ class JAVA : public Language {
String *jenvstr = NewString("jenv");
String *jobjstr = NewString("jobj");
Wrapper_add_localv(w, jenvstr, "JNIEnv *", jenvstr, "= (JNIEnv *) NULL", NIL);
Wrapper_add_localv(w, "jnienv", "JNIEnvWrapper", "jnienv(this)", NIL, NIL);
Wrapper_add_localv(w, jenvstr, "JNIEnv *", jenvstr, "= jnienv.getJNIEnv()", NIL);
Wrapper_add_localv(w, jobjstr, "jobject ", jobjstr, "= (jobject) NULL", NIL);
Delete(jenvstr);
Delete(jobjstr);
@ -3174,7 +3175,6 @@ class JAVA : public Language {
Delete(super_call);
}
} else {
Printf(w->code, "jenv = swig_acquire_jenv();\n");
Printf(w->code, "SWIG_JavaThrowException(jenv, SWIG_JavaDirectorPureVirtual,\n");
Printf(w->code, " \"Attempted to invoke pure virtual method %s::%s.\");\n",
c_classname, name);
@ -3188,7 +3188,6 @@ class JAVA : public Language {
}
Printf(w->code, "}\n");
Printf(w->code, "jenv = swig_acquire_jenv();\n");
Printf(w->code, "jobj = swig_get_self(jenv);\n");
Printf(w->code, "if (jobj && jenv->IsSameObject(jobj, NULL) == JNI_FALSE) {\n");