From 2762e0becadbf35003fb829994120a9336f952f3 Mon Sep 17 00:00:00 2001 From: Jaehong Jo Date: Tue, 18 Aug 2015 20:36:16 +0900 Subject: [PATCH] Fix Android EDR crash issues. CAEDRServerStop is called twice. So occure reference to invalid global. Change-Id: I5652b53cf78257a8c59a9ffcf67cfe58879855a1 Signed-off-by: Jaehong Jo Reviewed-on: https://gerrit.iotivity.org/gerrit/2231 Tested-by: jenkins-iotivity Reviewed-by: Naga Ashok Jampani Reviewed-by: Jon A. Cruz --- resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c | 2 ++ resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c b/resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c index 20e0c22..c54411a 100644 --- a/resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c +++ b/resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c @@ -1145,6 +1145,7 @@ void CAEDRNatvieCloseServerTask(JNIEnv* env) jmethodID jni_mid_close = (*env)->GetMethodID(env, jni_cid_InputStream, "close", "()V"); (*env)->CallVoidMethod(env, g_inputStream, jni_mid_close); (*env)->DeleteGlobalRef(env, g_inputStream); + g_inputStream = NULL; } if (g_serverSocket) @@ -1167,6 +1168,7 @@ void CAEDRNatvieCloseServerTask(JNIEnv* env) } (*env)->CallVoidMethod(env, g_serverSocket, jni_mid_accept); (*env)->DeleteGlobalRef(env, g_serverSocket); + g_serverSocket = NULL; OIC_LOG(DEBUG, TAG, "[EDR][Native] close accept obj"); } diff --git a/resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c b/resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c index d1bf5b4..7048867 100644 --- a/resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c +++ b/resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c @@ -370,8 +370,6 @@ void CATerminateEDR() { OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "IN"); - // Stop EDR adapter - CAStopEDR(); // Terminate EDR Network Monitor CAEDRTerminateNetworkMonitor(); -- 2.7.4