From: Jaehyun Kim Date: Wed, 15 Feb 2023 03:02:58 +0000 (+0900) Subject: Clear all callback timers when deinit X-Git-Tag: accepted/tizen/7.0/unified/20230216.140342^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F02%2F288302%2F1;p=platform%2Fcore%2Fapi%2Fwifi-manager.git Clear all callback timers when deinit Change-Id: I4bbd9d2e34378842ff5039552ac9795e5ba2f62a Signed-off-by: Jaehyun Kim --- diff --git a/src/network_interface.c b/src/network_interface.c index af602dd..28ee41b 100644 --- a/src/network_interface.c +++ b/src/network_interface.c @@ -1277,6 +1277,34 @@ static int __net_extract_connected_profile(network_info_s *network_info, return err; } +static void _net_clear_cb_timers(void) +{ + if (connection_cb_timer > 0) { + g_source_remove(connection_cb_timer); + connection_cb_timer = 0; + } + + if (full_scan_cb_timer > 0) { + g_source_remove(full_scan_cb_timer); + full_scan_cb_timer = 0; + } + + if (specific_scan_cb_timer > 0) { + g_source_remove(specific_scan_cb_timer); + specific_scan_cb_timer = 0; + } + + if (multi_scan_cb_timer > 0) { + g_source_remove(multi_scan_cb_timer); + multi_scan_cb_timer = 0; + } + + if (bssid_scan_cb_timer > 0) { + g_source_remove(bssid_scan_cb_timer); + bssid_scan_cb_timer = 0; + } +} + void net_forget_ap_finished(network_info_s *network_info, net_err_e Error) { __NETWORK_FUNC_ENTER__; @@ -2202,27 +2230,7 @@ int net_wifi_power_off(network_info_s *network_info) return NET_ERR_IN_PROGRESS; //LCOV_EXCL_LINE } - if (connection_cb_timer > 0) { - g_source_remove(connection_cb_timer); - connection_cb_timer = 0; - } - - if (full_scan_cb_timer > 0) { - g_source_remove(full_scan_cb_timer); - full_scan_cb_timer = 0; - } - if (specific_scan_cb_timer > 0) { - g_source_remove(specific_scan_cb_timer); - specific_scan_cb_timer = 0; - } - if (multi_scan_cb_timer > 0) { - g_source_remove(multi_scan_cb_timer); - multi_scan_cb_timer = 0; - } - if (bssid_scan_cb_timer > 0) { - g_source_remove(bssid_scan_cb_timer); - bssid_scan_cb_timer = 0; - } + _net_clear_cb_timers(); if (network_info->request_table[NETWORK_REQUEST_TYPE_SCAN].flag == TRUE) memset(&(network_info->request_table[NETWORK_REQUEST_TYPE_SCAN]), @@ -2944,6 +2952,7 @@ void net_deregister_client_ext(network_info_s *network_info) network_info->user_data = NULL; network_info->wifi_handle = NULL; + _net_clear_cb_timers(); _net_deregister_signal(network_info); _net_dbus_close_gdbus_call(network_info); _net_clear_request_table(network_info);