From d71fb7935be69ef04c3d2bbc7ae270d326345b1e Mon Sep 17 00:00:00 2001 From: AAGaming Date: Thu, 27 Jun 2024 01:43:01 -0400 Subject: fix plugin uninstall dialog issues --- backend/decky_loader/plugin/plugin.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'backend/decky_loader/plugin/plugin.py') diff --git a/backend/decky_loader/plugin/plugin.py b/backend/decky_loader/plugin/plugin.py index 61b5ca4f..94e411bc 100644 --- a/backend/decky_loader/plugin/plugin.py +++ b/backend/decky_loader/plugin/plugin.py @@ -108,11 +108,9 @@ class PluginWrapper: self._listener_task = create_task(self._response_listener()) return self - def stop(self, uninstall: bool = False): + async def stop(self, uninstall: bool = False): + if hasattr(self, "_socket"): + await self._socket.write_single_line(dumps({ "stop": True, "uninstall": uninstall }, ensure_ascii=False)) + await self._socket.close_socket_connection() if hasattr(self, "_listener_task"): - self._listener_task.cancel() - async def _(self: PluginWrapper): - if hasattr(self, "_socket"): - await self._socket.write_single_line(dumps({ "stop": True, "uninstall": uninstall }, ensure_ascii=False)) - await self._socket.close_socket_connection() - create_task(_(self)) \ No newline at end of file + self._listener_task.cancel() \ No newline at end of file -- cgit v1.2.3