From b484192390ff5b088732dfcf9cb70356bfd5706a Mon Sep 17 00:00:00 2001 From: echel0n Date: Mon, 28 Jul 2014 17:40:11 -0700 Subject: [PATCH] Fixed issue with threads not exiting on shutdown properly. --- sickbeard/__init__.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index 89ac1013..dd13d18d 100755 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -1171,13 +1171,6 @@ def halt(): logger.log(u"Aborting all threads") - events.stop.set() - logger.log(u"Waiting for the EVENTS thread to exit") - try: - events.join() - except: - pass - dailySearchScheduler.stop.set() logger.log(u"Waiting for the DAILYSEARCH thread to exit") try: @@ -1256,10 +1249,16 @@ def halt(): except: pass + events.stop.set() + logger.log(u"Waiting for the EVENTS thread to exit") + try: + events.join(10) + except: + pass + __INITIALIZED__ = False started = False - def sig_handler(signum=None, frame=None): if type(signum) != type(None): logger.log(u"Signal %i caught, saving and exiting..." % int(signum))