2007-02-01 Marco Trudel <mtrudel@gmx.ch>
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Feb 2007 22:45:11 +0000 (22:45 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Feb 2007 22:45:11 +0000 (22:45 +0000)
* jni.cc (_Jv_JNI_DeleteWeakGlobalRef): Check for NULL objects.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121699 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/jni.cc

index 06c1a1f..561f826 100644 (file)
@@ -1,3 +1,7 @@
+2007-02-01 Marco Trudel <mtrudel@gmx.ch>
+
+       * jni.cc (_Jv_JNI_DeleteWeakGlobalRef): Check for NULL objects.
+
 2007-02-07  Tom Tromey  <tromey@redhat.com>
 
        * testsuite/libjava.jni/init.c: New file.
index 07ef713..d71b16d 100644 (file)
@@ -1750,6 +1750,10 @@ _Jv_JNI_NewWeakGlobalRef (JNIEnv *env, jobject obj)
 void JNICALL
 _Jv_JNI_DeleteWeakGlobalRef (JNIEnv *, jweak obj)
 {
+  // JDK compatibility.
+  if (obj == NULL)
+    return;
+
   using namespace gnu::gcj::runtime;
   JNIWeakRef *ref = reinterpret_cast<JNIWeakRef *> (obj);
   unmark_for_gc (ref, global_ref_table);