mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-01-28 22:01:24 +00:00
Merge pull request #94 from Thesacraft/Shutdown-threads-safely
Shuts the threads down before quitting the application Fixes #86
This commit is contained in:
@@ -79,9 +79,10 @@ class Consumer(QThread):
|
||||
QThread.__init__(self)
|
||||
|
||||
def run(self):
|
||||
while True:
|
||||
self.active = True
|
||||
while self.active:
|
||||
try:
|
||||
job = self.queue.get()
|
||||
job = self.queue.get(timeout=0.2)
|
||||
# print('Running job...')
|
||||
# logging.info(*job[1])
|
||||
job[0](*job[1])
|
||||
@@ -411,6 +412,11 @@ class QtDriver(QObject):
|
||||
self.save_library()
|
||||
self.settings.setValue("last_library", self.lib.library_dir)
|
||||
self.settings.sync()
|
||||
logging.info("[SHUTDOWN] Ending Thumbnail Threads...")
|
||||
for thread in self.thumb_threads:
|
||||
thread.active=False
|
||||
thread.quit()
|
||||
thread.wait()
|
||||
QApplication.quit()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user