Prevent for deinitialize operation twice 71/187371/1 accepted/tizen/unified/20180827.160626 submit/tizen/20180827.065334
authorJihoon Jung <jh8801.jung@samsung.com>
Wed, 22 Aug 2018 09:27:06 +0000 (18:27 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Wed, 22 Aug 2018 09:27:34 +0000 (18:27 +0900)
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: I5c56c98b52bf6f677e481aaee1da6bd66aa5ad36

src/manager/net_nfc_server_common.c

index 36c3243f87ce2a7f7a7b6f615d56ba23b20c1184..32233ec6b241e59ac71cc7fccb0fa7d6d3ff351c 100755 (executable)
@@ -69,6 +69,7 @@ static guint32 server_state = NET_NFC_SERVER_IDLE;
 
 static gint controller_block;
 
+static gboolean deinit_is_running = FALSE;
 static gboolean check_nfc_disable = FALSE;
 
 static void controller_async_queue_free_func(gpointer user_data)
@@ -519,9 +520,12 @@ void net_nfc_server_controller_deinit(void)
        }
 
        /* block all other message because daemon will be shutting down */
-       controller_block = 9999;
+       if (deinit_is_running == false) {
+               deinit_is_running = true;
+               controller_block = 9999;
 
-       _push_to_queue(0, false, controller_deinit_thread_func, NULL);
+               _push_to_queue(0, false, controller_deinit_thread_func, NULL);
+       }
 }
 #endif