# HG changeset patch
# User Edouard Tisserant
# Date 1555590595 -7200
# Node ID 9c5b20dc2b2e75f60b86e800af6e362606efd47d
# Parent  0e20a0d48fae80618818b140de568a4d80ee6db1
Enure that all threads are joined before trying to exit

diff -r 0e20a0d48fae -r 9c5b20dc2b2e Beremiz_service.py
--- a/Beremiz_service.py	Wed Apr 17 14:18:22 2019 +0200
+++ b/Beremiz_service.py	Thu Apr 18 14:29:55 2019 +0200
@@ -582,6 +582,7 @@
     pass
 
 pyroserver.Quit()
+pyro_thread.join()
 
 plcobj = runtime.GetPLCObjectSingleton()
 plcobj.StopPLC()
@@ -589,7 +590,9 @@
 
 if havetwisted:
     reactor.stop()
+    ui_thread.join()
 elif havewx:
     app.ExitMainLoop()
+    ui_thread.join()
 
 sys.exit(0)