From df05db803269c0a183c90b3100ba1258b220bb51 Mon Sep 17 00:00:00 2001 From: Harry Date: Wed, 2 May 2018 19:03:34 +0530 Subject: [PATCH] Clearing pending exceptions in JNI env https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/287 (cherry picked from commit 312f0a735dea35925da0d80a916d0d9cf542932e) Change-Id: I2830f50706a5818375745a406d3ff4b7f8ecdb1c Signed-off-by: Harry Signed-off-by: Amit KS --- resource/csdk/connectivity/src/ip_adapter/android/caipnwmonitor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resource/csdk/connectivity/src/ip_adapter/android/caipnwmonitor.c b/resource/csdk/connectivity/src/ip_adapter/android/caipnwmonitor.c index e584626..8f67d47 100644 --- a/resource/csdk/connectivity/src/ip_adapter/android/caipnwmonitor.c +++ b/resource/csdk/connectivity/src/ip_adapter/android/caipnwmonitor.c @@ -436,6 +436,8 @@ static CAResult_t CAIPDestroyJniInterface() isAttached = true; } + CACheckJNIException(env); + jclass jni_IpInterface = (*env)->FindClass(env, "org/iotivity/ca/CaIpInterface"); if (!jni_IpInterface) { @@ -454,11 +456,9 @@ static CAResult_t CAIPDestroyJniInterface() (*env)->CallStaticVoidMethod(env, jni_IpInterface, jni_InterfaceDestroyMethod); - if ((*env)->ExceptionCheck(env)) + if (CACheckJNIException(env)) { OIC_LOG(ERROR, TAG, "destroyIpInterface has failed"); - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); goto error_exit; } -- 2.7.4