Update list->count to '0' on failure 75/85175/1 accepted/tizen/common/20160831.161336 accepted/tizen/ivi/20160831.075846 accepted/tizen/mobile/20160831.075720 accepted/tizen/tv/20160831.075745 accepted/tizen/wearable/20160831.075815 submit/tizen/20160831.002039
authorWootak Jung <wootak.jung@samsung.com>
Wed, 24 Aug 2016 04:39:18 +0000 (13:39 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Wed, 24 Aug 2016 04:39:18 +0000 (13:39 +0900)
Remove notifications before de-initilizaling handles

Change-Id: I3e84ffb86f239880548868696a783edf6f35b4ca

packaging/capi-telephony.spec
src/telephony_common.c

index 82797c69924f9924768e4d76e31d0b9cbaaefb06..a9250eabdb04e9192f6937355e085f38e6f17fe8 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-telephony
 Summary:    Telephony Core API
-Version:    0.1.65
+Version:    0.1.66
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index 2849f75dfb9b062e660833ad723953f1112653c1..c6065578aeaf150ed7ecfd341bf02f0b5980d580 100644 (file)
@@ -476,6 +476,7 @@ int telephony_init(telephony_handle_list_s *list)
        cp_list = tel_get_cp_name_list();
        if (cp_list == NULL) {
                LOGE("cp_list is NULL");
+               list->count = 0;
                return TELEPHONY_ERROR_OPERATION_FAILED;
        }
 
@@ -545,14 +546,14 @@ int telephony_deinit(telephony_handle_list_s *list)
        for (i = 0; i < list->count; i++) {
                telephony_data *tmp = (telephony_data *)list->handle[i];
 
-               /* De-init all TapiHandle */
-               tel_deinit(tmp->tapi_h);
-               tmp->tapi_h = NULL;
-
                /* De-register all registered events */
                g_slist_free_full(tmp->evt_list, _deregister_noti);
                tmp->evt_list = NULL;
 
+               /* De-init all TapiHandle */
+               tel_deinit(tmp->tapi_h);
+               tmp->tapi_h = NULL;
+
                /* Free handle[i] */
                free(list->handle[i]);
        }