From b22a895ddd0e54ce35240ebd10b09ffa00581ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Mon, 15 Jun 2015 18:29:08 +0200 Subject: [PATCH] Ensure graceful teardown of the reactor thread --- src/frida/application.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frida/application.py b/src/frida/application.py index c4b7a2b..90abbaa 100755 --- a/src/frida/application.py +++ b/src/frida/application.py @@ -271,12 +271,13 @@ class Reactor(object): with self._lock: self._running = True - watcher_thread = threading.Thread(target=self._run) - watcher_thread.daemon = True - watcher_thread.start() + worker = threading.Thread(target=self._run) + worker.start() self._run_until_return(self) + self.stop() + worker.join() def _run(self): running = True