From: Jaewook Jung Date: Tue, 30 Aug 2016 09:29:33 +0000 (+0900) Subject: fix bug on JniOnObserveListener related to AccountManager X-Git-Tag: 1.2.0+RC3~231 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ecdbe08878bbbbcf8b8e93269d0dd29bf73472b2;p=platform%2Fupstream%2Fiotivity.git fix bug on JniOnObserveListener related to AccountManager Change-Id: I5d5f77838c66aff4cfe1c4bbf7d04d5386a222f2 Signed-off-by: Jaewook Jung Reviewed-on: https://gerrit.iotivity.org/gerrit/11129 Tested-by: jenkins-iotivity Reviewed-by: Jaehong Jo Reviewed-by: Jon A. Cruz --- diff --git a/android/android_api/base/jni/JniOnObserveListener.cpp b/android/android_api/base/jni/JniOnObserveListener.cpp index 1bb3c23..060b19e 100644 --- a/android/android_api/base/jni/JniOnObserveListener.cpp +++ b/android/android_api/base/jni/JniOnObserveListener.cpp @@ -166,7 +166,18 @@ void JniOnObserveListener::onObserveCallback(const HeaderOptions headerOptions, env->DeleteLocalRef(jHeaderOptionList); jthrowable ex = env->ExceptionOccurred(); env->ExceptionClear(); +#ifndef WITH_CLOUD m_ownerResource->removeOnObserveListener(env, m_jwListener); +#else + if (nullptr != m_ownerResource) + { + m_ownerResource->removeOnObserveListener(env, m_jwListener); + } + if (nullptr != m_ownerAccountManager) + { + m_ownerAccountManager->removeOnObserveListener(env, m_jwListener); + } +#endif env->Throw((jthrowable)ex); }