Destroy publish before session
authorCheoleun Moon <chleun.moon@samsung.com>
Wed, 8 Apr 2020 05:39:14 +0000 (14:39 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Wed, 8 Apr 2020 05:39:14 +0000 (14:39 +0900)
test/wifi-aware-publish-test.c
test/wifi-aware-subscribe-test.c

index b2342e7..ee0464f 100644 (file)
@@ -574,6 +574,10 @@ void clear_resources()
        }
        g_ndp = NULL;
 
+       if (g_publish_handle)
+               wifi_aware_publish_destroy(g_publish_handle);
+       g_publish_handle = NULL;
+
        if (g_wifi_aware_session) {
                wifi_aware_session_destroy(g_wifi_aware_session);
                wifi_aware_session_unset_message_received_cb(g_wifi_aware_session);
@@ -581,10 +585,6 @@ void clear_resources()
        }
        g_wifi_aware_session = NULL;
 
-       if (g_publish_handle)
-               wifi_aware_publish_destroy(g_publish_handle);
-       g_publish_handle = NULL;
-
        g_peer = NULL;
 }
 
index e97145f..658c640 100644 (file)
@@ -645,6 +645,10 @@ void clear_resources()
        }
        g_ndp = NULL;
 
+       if (g_subscribe_handle)
+               wifi_aware_subscribe_destroy(g_subscribe_handle);
+       g_subscribe_handle = NULL;
+
        if (g_wifi_aware_session) {
                wifi_aware_session_destroy(g_wifi_aware_session);
                wifi_aware_session_unset_message_received_cb(g_wifi_aware_session);
@@ -653,10 +657,6 @@ void clear_resources()
        }
        g_wifi_aware_session = NULL;
 
-       if (g_subscribe_handle)
-               wifi_aware_subscribe_destroy(g_subscribe_handle);
-       g_subscribe_handle = NULL;
-
        g_peer = NULL;
 }