Fix disconnect handler callback being called on every session

This commit is contained in:
Dan 2018-06-24 19:29:12 +02:00
parent fa7b7d0ce3
commit c7d60ef8a6

View File

@ -197,7 +197,7 @@ class Session:
for i in self.results.values(): for i in self.results.values():
i.event.set() i.event.set()
if self.client and callable(self.client.disconnect_handler): if not self.is_media and callable(self.client.disconnect_handler):
try: try:
self.client.disconnect_handler(self.client) self.client.disconnect_handler(self.client)
except Exception as e: except Exception as e: