Fix memory leak in legacy nest (#49469)

pull/49494/head
J. Nick Koston 2021-04-20 06:14:23 -10:00 committed by GitHub
parent d858d2ff25
commit 7791670607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -249,7 +249,9 @@ async def async_setup_legacy_entry(hass, entry):
"""Stop Nest update event listener."""
nest.update_event.set()
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, shut_down)
entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, shut_down)
)
_LOGGER.debug("async_setup_nest is done")