ext/load.c in rjb-1.3.8 vs ext/load.c in rjb-1.3.9
- old
+ new
@@ -10,11 +10,11 @@
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
- * $Id: load.c 167 2011-07-15 17:40:25Z arton $
+ * $Id: load.c 180 2011-12-05 16:34:29Z arton $
*/
#include <stdlib.h>
#include <stdio.h>
#include "ruby.h"
@@ -267,9 +267,18 @@
nmethod[0].signature = "(Ljava/lang/String;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;";
nmethod[0].fnPtr = Java_jp_co_infoseek_hp_arton_rjb_RBridge_call;
(*jenv)->RegisterNatives(jenv, rjb_rbridge, nmethod, 1);
rjb_rbridge = (*jenv)->NewGlobalRef(jenv, rjb_rbridge);
return 0;
+}
+
+void rjb_unload_vm()
+{
+ if (RTEST(jvmdll))
+ {
+ rb_funcall(jvmdll, rb_intern("close"), 0);
+ jvmdll = Qnil;
+ }
}
int rjb_create_jvm(JNIEnv** pjenv, JavaVMInitArgs* vm_args, char* userpath, VALUE argv)
{
static JavaVMOption soptions[] = {