mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Clear thread lists when stopping. Related to #62
This commit is contained in:
parent
68cd19baa4
commit
33c417942c
@ -385,12 +385,16 @@ class Client:
|
||||
for i in self.updates_workers_list:
|
||||
i.join()
|
||||
|
||||
self.updates_workers_list.clear()
|
||||
|
||||
for _ in range(self.DOWNLOAD_WORKERS):
|
||||
self.download_queue.put(None)
|
||||
|
||||
for i in self.download_workers_list:
|
||||
i.join()
|
||||
|
||||
self.download_workers_list.clear()
|
||||
|
||||
self.dispatcher.stop()
|
||||
|
||||
self.is_started = False
|
||||
|
@ -68,6 +68,8 @@ class Dispatcher:
|
||||
for i in self.workers_list:
|
||||
i.join()
|
||||
|
||||
self.workers_list.clear()
|
||||
|
||||
def add_handler(self, handler, group: int):
|
||||
if group not in self.groups:
|
||||
self.groups[group] = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user