From: chleun.moon Date: Thu, 12 Oct 2017 09:03:11 +0000 (+0900) Subject: Reset scan_request_cb before calling scan_request_cb X-Git-Tag: accepted/tizen/unified/20171013.192922^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F91%2F155191%2F1;p=platform%2Fcore%2Fapi%2Fwifi-manager.git Reset scan_request_cb before calling scan_request_cb If the second wifi_manager_scan() is called in wifi_manager_scan_finished_cb of the first wifi_manager_scan(), the callback of the second wifi_manager_scan() will never be called. Change-Id: I9e6c0ca03beea802bda5d53048aff725e1e60eef Signed-off-by: Cheoleun Moon --- diff --git a/packaging/capi-network-wifi-manager.spec b/packaging/capi-network-wifi-manager.spec index aef4f99..6b83ede 100755 --- a/packaging/capi-network-wifi-manager.spec +++ b/packaging/capi-network-wifi-manager.spec @@ -1,6 +1,6 @@ Name: capi-network-wifi-manager Summary: Network Wi-Fi library in TIZEN C API -Version: 1.0.20 +Version: 1.0.21 Release: 1 Group: System/Network License: Apache-2.0 diff --git a/src/wifi_internal.c b/src/wifi_internal.c index d3cf0ab..feb49cb 100755 --- a/src/wifi_internal.c +++ b/src/wifi_internal.c @@ -633,11 +633,14 @@ static void __scan_cb(net_event_info_s *event_cb, bool is_requested) if (_wifi_get_callback_count_from_handle_list(WIFI_SCAN_REQUEST_CB)) { for (list = wifi_manager_handle_list; list; list = list->next) { wifi_manager_handle_s *local_handle = (wifi_manager_handle_s *)list->data; - if (local_handle->scan_request_cb) - local_handle->scan_request_cb(error_code, local_handle->scan_request_user_data); - + wifi_manager_scan_finished_cb cb = local_handle->scan_request_cb; + void* user_data = local_handle->scan_request_user_data; local_handle->scan_request_cb = NULL; local_handle->scan_request_user_data = NULL; + + if (cb) + cb(error_code, user_data); + } return; }