summaryrefslogtreecommitdiff
path: root/libjava/jni.cc
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-07 22:45:11 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-07 22:45:11 +0000
commit6d84c3e2de7dfb7e3c7742541701ce67676d9735 (patch)
treedde78be310ecc3b5e900fbc50be51aea3f79076f /libjava/jni.cc
parent8f92f0732e74ef17dfb722cf457682843afe61d7 (diff)
downloadgcc-6d84c3e2de7dfb7e3c7742541701ce67676d9735.tar.gz
2007-02-01 Marco Trudel <mtrudel@gmx.ch>
* 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
Diffstat (limited to 'libjava/jni.cc')
-rw-r--r--libjava/jni.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/libjava/jni.cc b/libjava/jni.cc
index 07ef7134540..d71b16d99ea 100644
--- a/libjava/jni.cc
+++ b/libjava/jni.cc
@@ -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);