mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 18:51:59 +00:00
Call plugin unload function after stopping event loop (#539)
This can prevent race conditions where unload is clearing data but main is still working with it
This commit is contained in:
@@ -115,11 +115,11 @@ class SandboxedPlugin:
|
|||||||
|
|
||||||
if "stop" in data:
|
if "stop" in data:
|
||||||
self.log.info("Calling Loader unload function.")
|
self.log.info("Calling Loader unload function.")
|
||||||
await self._unload()
|
|
||||||
get_event_loop().stop()
|
get_event_loop().stop()
|
||||||
while get_event_loop().is_running():
|
while get_event_loop().is_running():
|
||||||
await sleep(0)
|
await sleep(0)
|
||||||
get_event_loop().close()
|
get_event_loop().close()
|
||||||
|
await self._unload()
|
||||||
raise Exception("Closing message listener")
|
raise Exception("Closing message listener")
|
||||||
|
|
||||||
d: SocketResponseDict = {"res": None, "success": True, "id": data["id"]}
|
d: SocketResponseDict = {"res": None, "success": True, "id": data["id"]}
|
||||||
|
|||||||
Reference in New Issue
Block a user