mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix task leak on config entry unload/retry (#96981)
Since the task was added to self._tasks without a `task.add_done_callback(self._tasks.remove)` each unload/retry would leak a new set of tasks
This commit is contained in:
parent
fd3bdeaef1
commit
4644355eff
@ -694,7 +694,7 @@ class ConfigEntry:
|
||||
if self._on_unload is not None:
|
||||
while self._on_unload:
|
||||
if job := self._on_unload.pop()():
|
||||
self._tasks.add(hass.async_create_task(job))
|
||||
self.async_create_task(hass, job)
|
||||
|
||||
if not self._tasks and not self._background_tasks:
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user