2
0
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:
Dan 2018-04-29 20:20:34 +02:00
parent 68cd19baa4
commit 33c417942c
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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] = []