Bug threadpool

This commit is contained in:
Fabien Servant 2023-12-29 12:28:33 +01:00
parent d32c3df1d0
commit a0dc87c19b
3 changed files with 12 additions and 0 deletions

View file

@ -62,6 +62,10 @@ class ThumbnailCache(QObject):
cleaningThread = None
workerThreads = ThreadPool(processes=3)
def __del__(self):
self.workerThreads.terminate()
self.workerThreads.join()
@staticmethod
def initialize():
"""Initialize static fields in cache class and cache directory on disk."""

View file

@ -48,6 +48,10 @@ class FilesModTimePollerThread(QObject):
else:
self._filePollerRefresh = PollerRefreshStatus.DISABLED
def __del__(self):
self._threadPool.terminate()
self._threadPool.join()
def start(self, files=None):
""" Start polling thread.

View file

@ -452,6 +452,10 @@ class Reconstruction(UIGraph):
self.setDefaultPipeline(defaultPipeline)
def __del__(self):
self._workerThreads.terminate()
self._workerThreads.join()
def clear(self):
self.clearActiveNodes()
super(Reconstruction, self).clear()