Fix memory leak on apple_tv reload (#49454)

This commit is contained in:
J. Nick Koston 2021-04-20 06:12:11 -10:00 committed by GitHub
parent baa8de2f89
commit 3cbfa36397
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -50,7 +50,9 @@ async def async_setup_entry(hass, entry):
"""Stop push updates when hass stops."""
await manager.disconnect()
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop)
entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop)
)
async def setup_platforms():
"""Set up platforms and initiate connection."""