[wing/join-thread] wingservice: join thread when notifying the stop




commit d4e827213b446c2d49099694a28a451686ce48eb
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Fri Apr 1 11:03:42 2022 +0200

    wingservice: join thread when notifying the stop
    
    Otherwise the thread might be around when exitting the service

 wing/wingservice.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/wing/wingservice.c b/wing/wingservice.c
index 15c87b5..fc35b26 100644
--- a/wing/wingservice.c
+++ b/wing/wingservice.c
@@ -765,6 +765,12 @@ wing_service_notify_stopped (WingService *service)
   g_return_if_fail (WING_IS_SERVICE (service));
 
   set_service_status (service, SERVICE_STOPPED);
+
+  if (priv->thread != NULL)
+    {
+      g_thread_join (priv->thread);
+      priv->thread = NULL;
+    }
 }
 
 static gint


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]