From 2279b5593df3f1c257be12e4d01e35288b517b1e Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 20 Apr 2021 06:12:32 -1000 Subject: [PATCH] Fix memory leak in vera (#49459) --- homeassistant/components/vera/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/vera/__init__.py b/homeassistant/components/vera/__init__.py index 3654db5072d..9feba3cd08d 100644 --- a/homeassistant/components/vera/__init__.py +++ b/homeassistant/components/vera/__init__.py @@ -155,7 +155,9 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b controller.stop() await hass.async_add_executor_job(controller.start) - hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_subscription) + config_entry.async_on_unload( + hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_subscription) + ) return True