Closed Jan200101 closed 6 months ago
This can prevent race conditions where unload is clearing data but main is still working with it
Please tick as appropriate:
If you're wanting to update a translation or add a new one, please use the weblate page: https://weblate.werwolv.net/projects/decky/
During the unload long-running code is still active causing possible race conditions when unloads cleans up data which main was referencing.
class Plugin: data = [] async def _main(self): while True: self.data.append(len(self.data)) decky_plugin.logger.info(self.data) await asyncio.sleep(0.1) async def _unload(self): self.data = None
Going to give this a go. Apologies it took so long to get to this. (Edit: Had to manually rebase PR locally for testing purposes.)
This can prevent race conditions where unload is clearing data but main is still working with it
Please tick as appropriate:
If you're wanting to update a translation or add a new one, please use the weblate page: https://weblate.werwolv.net/projects/decky/
Description
During the unload long-running code is still active causing possible race conditions when unloads cleans up data which main was referencing.
Example Plugin