toxav kill fixed

This commit is contained in:
ingvar1995 2018-08-25 14:45:58 +03:00
parent 6e07d3e3d4
commit ee994973db
3 changed files with 7 additions and 4 deletions

View File

@ -107,7 +107,7 @@ class App:
self._tray.hide()
self._save_profile()
self._settings.close()
self._calls_manager.set_toxav(None)
self._kill_toxav()
del self._tox
# -----------------------------------------------------------------------------------------------------------------
@ -319,7 +319,7 @@ class App:
self._stop_threads(False)
data = self._tox.get_savedata()
self._save_profile(data)
self._calls_manager.set_toxav(None)
self._kill_toxav()
del self._tox
# create new tox instance
self._tox = self._create_tox(data)
@ -411,3 +411,7 @@ class App:
def _init_profile(self):
if not self._profile.has_avatar():
self._profile.reset_avatar(self._settings['identicons'])
def _kill_toxav(self):
self._calls_manager.set_toxav(None)
self._tox.AV.kill()

View File

@ -121,7 +121,6 @@ class Tox:
self.AV = ToxAV(self._tox_pointer)
def __del__(self):
del self.AV
Tox.libtoxcore.tox_kill(self._tox_pointer)
# -----------------------------------------------------------------------------------------------------------------

View File

@ -40,7 +40,7 @@ class ToxAV:
self.video_receive_frame_cb = None
self.call_cb = None
def __del__(self):
def kill(self):
"""
Releases all resources associated with the A/V session.