Make sure to destroy context after thread gets joined 92/224092/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 6 Feb 2020 07:25:07 +0000 (16:25 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 6 Feb 2020 07:28:36 +0000 (16:28 +0900)
Change-Id: I44468b6fca2f456cdc136ffd071eadc8cd82472e

src/legacy_support/websocket.cpp

index 3e218d7..50e24e1 100644 (file)
@@ -502,8 +502,6 @@ bool CWebHelperAgentWebSocket::exit()
     g_ws_server_exit = true;
     if (g_ws_server_context) {
         lws_cancel_service(g_ws_server_context);
-        lws_context_destroy(g_ws_server_context);
-        g_ws_server_context = NULL;
     }
 
     if (m_message_pipe) {
@@ -520,6 +518,11 @@ bool CWebHelperAgentWebSocket::exit()
 
     pthread_mutex_destroy(&g_ws_server_mutex);
 
+    if (g_ws_server_context) {
+        lws_context_destroy(g_ws_server_context);
+        g_ws_server_context = NULL;
+    }
+
     ecore_shutdown();
 
     return true;