}
/* Check for JNI exceptions. If there is one such exception, clear
- it, then delete the local reference to OBJECT and call
- memory_full. */
+ it, then delete the local reference to OBJECT and call memory_full.
+ OBJECT can be NULL, which is a valid local reference to the Java
+ null object. */
void
android_exception_check_1 (jobject object)
/* Describe exactly what went wrong. */
(*android_java_env)->ExceptionDescribe (android_java_env);
(*android_java_env)->ExceptionClear (android_java_env);
- ANDROID_DELETE_LOCAL_REF (object);
+
+ if (object)
+ ANDROID_DELETE_LOCAL_REF (object);
+
memory_full (0);
}
/* Describe exactly what went wrong. */
(*android_java_env)->ExceptionDescribe (android_java_env);
(*android_java_env)->ExceptionClear (android_java_env);
- ANDROID_DELETE_LOCAL_REF (object);
- ANDROID_DELETE_LOCAL_REF (object1);
+
+ if (object)
+ ANDROID_DELETE_LOCAL_REF (object);
+
+ if (object)
+ ANDROID_DELETE_LOCAL_REF (object1);
+
memory_full (0);
}
/* Describe exactly what went wrong. */
(*android_java_env)->ExceptionDescribe (android_java_env);
(*android_java_env)->ExceptionClear (android_java_env);
- ANDROID_DELETE_LOCAL_REF (object);
- ANDROID_DELETE_LOCAL_REF (object1);
- ANDROID_DELETE_LOCAL_REF (object2);
+
+ if (object)
+ ANDROID_DELETE_LOCAL_REF (object);
+
+ if (object)
+ ANDROID_DELETE_LOCAL_REF (object1);
+
+ if (object)
+ ANDROID_DELETE_LOCAL_REF (object2);
+
memory_full (0);
}
/* Describe exactly what went wrong. */
(*android_java_env)->ExceptionDescribe (android_java_env);
(*android_java_env)->ExceptionClear (android_java_env);
- ANDROID_DELETE_LOCAL_REF (object);
- ANDROID_DELETE_LOCAL_REF (object1);
- ANDROID_DELETE_LOCAL_REF (object2);
- ANDROID_DELETE_LOCAL_REF (object3);
+
+ if (object)
+ ANDROID_DELETE_LOCAL_REF (object);
+
+ if (object)
+ ANDROID_DELETE_LOCAL_REF (object1);
+
+ if (object)
+ ANDROID_DELETE_LOCAL_REF (object2);
+
+ if (object)
+ ANDROID_DELETE_LOCAL_REF (object3);
+
memory_full (0);
}
buffer = (*android_java_env)->GetStringUTFChars (android_java_env,
(jstring) value,
NULL);
- android_exception_check_1 (string);
+ android_exception_check_1 (value);
/* Otherwise, build the string describing the error. */
tem = build_string_from_utf8 (buffer);