system/ui: fix WiFi manager shutdown task errors (#35204)

fix WiFi manager shutdown task errors
This commit is contained in:
Dean Lee
2025-05-15 02:20:39 +08:00
committed by GitHub
parent f1c0109c89
commit 84e9b75983
+5 -3
View File
@@ -115,7 +115,7 @@ class WifiManager:
except asyncio.CancelledError:
pass
if self.bus:
await self.bus.disconnect()
self.bus.disconnect()
async def request_scan(self) -> None:
try:
@@ -634,8 +634,10 @@ class WifiManagerWrapper:
def shutdown(self) -> None:
if self._running:
if self._manager is not None:
self._run_coroutine(self._manager.shutdown())
if self._manager is not None and self._loop:
shutdown_future = asyncio.run_coroutine_threadsafe(self._manager.shutdown(), self._loop)
shutdown_future.result(timeout=3.0)
if self._loop and self._loop.is_running():
self._loop.call_soon_threadsafe(self._loop.stop)
if self._thread and self._thread.is_alive():