mirror of
https://github.com/Kilian/Trimage.git
synced 2026-01-26 10:08:40 -05:00
Remove unreachable shutdown code
* Implementing `__del__` is discouraged * Imports (i.e. `import logging`) are cleaned up, leading to NoneType related errors * When running via GUI mode, the shutdown code is never reached; we can let Python's internal GC clean everything
This commit is contained in:
parent
224f6b3503
commit
8af532f25e
2 changed files with 0 additions and 10 deletions
|
|
@ -30,9 +30,6 @@ class ThreadPoolMixIn:
|
||||||
def __init__(self, threadpool=None):
|
def __init__(self, threadpool=None):
|
||||||
if (threadpool == None):
|
if (threadpool == None):
|
||||||
threadpool = ThreadPool()
|
threadpool = ThreadPool()
|
||||||
self.__private_threadpool = True
|
|
||||||
else:
|
|
||||||
self.__private_threadpool = False
|
|
||||||
|
|
||||||
self.__threadpool = threadpool
|
self.__threadpool = threadpool
|
||||||
|
|
||||||
|
|
@ -52,10 +49,6 @@ class ThreadPoolMixIn:
|
||||||
def process_request(self, request, client_address):
|
def process_request(self, request, client_address):
|
||||||
self.__threadpool.add_job(self.process_request_thread, [request, client_address])
|
self.__threadpool.add_job(self.process_request_thread, [request, client_address])
|
||||||
|
|
||||||
def shutdown(self):
|
|
||||||
if (self.__private_threadpool): self.__threadpool.shutdown()
|
|
||||||
|
|
||||||
|
|
||||||
class AddJobException(Exception):
|
class AddJobException(Exception):
|
||||||
'''
|
'''
|
||||||
Exceptoion raised when a Job could not be added
|
Exceptoion raised when a Job could not be added
|
||||||
|
|
|
||||||
|
|
@ -409,9 +409,6 @@ class Worker(QThread):
|
||||||
self.toDisplay = Queue()
|
self.toDisplay = Queue()
|
||||||
self.threadpool = ThreadPool(max_workers=cpu_count())
|
self.threadpool = ThreadPool(max_workers=cpu_count())
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
self.threadpool.shutdown()
|
|
||||||
|
|
||||||
def compress_file(self, images, showapp, verbose, imagelist):
|
def compress_file(self, images, showapp, verbose, imagelist):
|
||||||
"""Start the worker thread."""
|
"""Start the worker thread."""
|
||||||
for image in images:
|
for image in images:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue