From d858d2ff254c0ea66d7eb771d823548a34b532eb Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 20 Apr 2021 06:14:11 -1000 Subject: [PATCH] Fix memory leak in deconz (#49468) --- homeassistant/components/deconz/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/deconz/__init__.py b/homeassistant/components/deconz/__init__.py index 8b609fe3126..eb659b870c1 100644 --- a/homeassistant/components/deconz/__init__.py +++ b/homeassistant/components/deconz/__init__.py @@ -45,7 +45,9 @@ async def async_setup_entry(hass, config_entry): await async_setup_services(hass) - hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, gateway.shutdown) + config_entry.async_on_unload( + hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, gateway.shutdown) + ) return True