Fix: [ALAS] Release cache after adb_restart()

This commit is contained in:
LmeSzinc 2024-07-23 23:49:58 +08:00
parent 73a84d10d2
commit 8d9e39fe5b

View File

@ -687,17 +687,19 @@ class Connection(ConnectionAttr):
# No adb connect if over http
return True
def adb_disconnect(self):
msg = self.adb_client.disconnect(self.serial)
if msg:
logger.info(msg)
def release_resource(self):
del_cached_property(self, 'hermit_session')
del_cached_property(self, 'droidcast_session')
del_cached_property(self, '_minitouch_builder')
del_cached_property(self, '_maatouch_builder')
del_cached_property(self, 'reverse_server')
def adb_disconnect(self):
msg = self.adb_client.disconnect(self.serial)
if msg:
logger.info(msg)
self.release_resource()
def adb_restart(self):
"""
Reboot adb client
@ -707,6 +709,7 @@ class Connection(ConnectionAttr):
self.adb_client.server_kill()
# Init adb client
del_cached_property(self, 'adb_client')
self.release_resource()
_ = self.adb_client
@Config.when(DEVICE_OVER_HTTP=False)