ThrowOcException(result, "unsubscribe presence has failed");
return;
}
- jweak jwOnPresenceListener =
- jniPresenceHandle->getJniOnPresenceListener()->getJWListener();
- if (jwOnPresenceListener)
- {
- RemoveOnPresenceListener(env, jwOnPresenceListener);
- }
- jweak jwOnObserveListener =
- jniPresenceHandle->getJniOnObserveListener()->getJWListener();
- if (jwOnObserveListener)
+
+ JniOnPresenceListener* jniPresenceListener = jniPresenceHandle->getJniOnPresenceListener();
+ if (jniPresenceListener)
{
- RemoveOnObserveListener(env, jwOnObserveListener);
+ jweak jwOnPresenceListener = jniPresenceListener->getJWListener();
+ if (jwOnPresenceListener)
+ {
+ RemoveOnPresenceListener(env, jwOnPresenceListener);
+ }
}
}
catch (OCException& e)