mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2024-07-30 21:27:34 +00:00
Ends threads before quitting application
This fixes this warning: QThread: Destroyed while thread is still running
This commit is contained in:
parent
93177dd696
commit
41e419c1e7
1 changed files with 7 additions and 1 deletions
|
@ -79,7 +79,8 @@ class Consumer(QThread):
|
|||
QThread.__init__(self)
|
||||
|
||||
def run(self):
|
||||
while True:
|
||||
self.active = True
|
||||
while self.active:
|
||||
try:
|
||||
job = self.queue.get()
|
||||
# print('Running job...')
|
||||
|
@ -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()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue