Reset g_timeout_id after removeing i t
authorCheoleun Moon <chleun.moon@samsung.com>
Wed, 8 Apr 2020 02:17:40 +0000 (11:17 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Wed, 8 Apr 2020 02:17:40 +0000 (11:17 +0900)
test/wifi-aware-subscribe-test.c

index b58a73b..c5f6b7d 100644 (file)
@@ -441,8 +441,10 @@ static void __service_discovered_cb(wifi_aware_session_h session,
        int ret = 0;
 
        PRINT_SUCCESS("[Event][Serivce Discovered]");
-       if (g_timeout_id > 0)
+       if (g_timeout_id > 0) {
                g_source_remove(g_timeout_id);
+               g_timeout_id = 0;
+       }
 
        ret = wifi_aware_peer_get_mac(peer, &mac);
        if (ret != WIFI_AWARE_ERROR_NONE) {