mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 06:17:07 +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
99def97ed9
commit
9fba6870fe
@ -687,7 +687,7 @@ class ConfigEntry:
|
|||||||
if self._on_unload is not None:
|
if self._on_unload is not None:
|
||||||
while self._on_unload:
|
while self._on_unload:
|
||||||
if job := self._on_unload.pop()():
|
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:
|
if not self._tasks and not self._background_tasks:
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user