fix zombie thread by detaching to avoid resource leak 21/173221/1 accepted/tizen/4.0/unified/20180326.075158 submit/tizen_4.0/20180323.102308
authorRavi Guntur <ravi.g@samsung.com>
Tue, 20 Mar 2018 05:06:40 +0000 (10:36 +0530)
committerRavi Guntur <ravi.g@samsung.com>
Tue, 20 Mar 2018 05:11:35 +0000 (10:41 +0530)
Signed-off-by: Ravi Guntur <ravi.g@samsung.com>
Change-Id: I8ee2881eb91474ecbddd6b42e1795df3fc5e28ac

src/heart/logging.c

index 80c3ea59a054f0dc39117e397dffef2a7b299b9d..bf9134ca84bb77c1428157c1a30dd82b210ffaf2 100644 (file)
@@ -1419,8 +1419,10 @@ int logging_sync(GDBusMethodInvocation *reply_invocation)
 
        sync_reply_invocation = reply_invocation;
 
-       if (!pthread_create(&logging_sync_thread, NULL, (void *)logging_sync_thread_main, NULL))
+       if (!pthread_create(&logging_sync_thread, NULL, (void *)logging_sync_thread_main, NULL)) {
+               pthread_detach(logging_sync_thread);
                return 0;
+       }
 
        _E("Failed to create logging sync thread");
        logging_sync_thread = 0;