[libbluray-devel] BD-J: always clear exception state ( PhoneME JVM asserts if exception is pending)
hpi1
git at videolan.org
Tue Jan 22 14:34:34 CET 2013
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Dec 20 13:43:19 2012 +0200| [c17ecee9383f20fd0e71e01acfd7cf4ddd93b7c8] | committer: hpi1
BD-J: always clear exception state (PhoneME JVM asserts if exception is pending)
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=c17ecee9383f20fd0e71e01acfd7cf4ddd93b7c8
---
src/libbluray/bdj/bdj_util.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/libbluray/bdj/bdj_util.c b/src/libbluray/bdj/bdj_util.c
index d6af2e3..c1b7fb1 100644
--- a/src/libbluray/bdj/bdj_util.c
+++ b/src/libbluray/bdj/bdj_util.c
@@ -54,6 +54,7 @@ int bdj_get_method(JNIEnv *env, jclass *cls, jmethodID *method_id,
if (!*cls) {
(*env)->ExceptionDescribe(env);
BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to locate class %s\n", class_name);
+ (*env)->ExceptionClear(env);
return 0;
}
@@ -64,6 +65,7 @@ int bdj_get_method(JNIEnv *env, jclass *cls, jmethodID *method_id,
class_name, method_name, method_sig);
(*env)->DeleteLocalRef(env, *cls);
*cls = NULL;
+ (*env)->ExceptionClear(env);
return 0;
}
@@ -100,5 +102,5 @@ int bdj_register_methods(JNIEnv *env, const char *class_name,
BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to register native methods for class %s\n", class_name);
}
- return error;
+ return !error;
}
More information about the libbluray-devel
mailing list