jni.cc (_Jv_JNI_DeleteWeakGlobalRef): Check for NULL objects.

2007-02-01 Marco Trudel <mtrudel@gmx.ch>

	* jni.cc (_Jv_JNI_DeleteWeakGlobalRef): Check for NULL objects.

From-SVN: r121699
This commit is contained in:
Marco Trudel 2007-02-07 23:45:11 +01:00 committed by Tom Tromey
parent 0ccadf458d
commit 304237321b
2 changed files with 8 additions and 0 deletions

View 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.

View 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);