From 922d8174b21ce2415ccd7736198da0c34c572bc7 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Thu, 11 Jul 2024 07:35:40 -0400 Subject: [PATCH] bugfix: unregister interest when we're done with a device --- src/server/input/default_input_device_hub.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/input/default_input_device_hub.cpp b/src/server/input/default_input_device_hub.cpp index f5fe01d7e28..6725f8edc7c 100644 --- a/src/server/input/default_input_device_hub.cpp +++ b/src/server/input/default_input_device_hub.cpp @@ -543,6 +543,11 @@ void mi::DefaultInputDeviceHub::remove_device(std::shared_ptr const BOOST_THROW_EXCEPTION(std::logic_error("Input device not managed by server")); } + if (auto const observer = std::dynamic_pointer_cast(device)) + { + led_observer_registrar->unregister_interest(*observer, (*pos)->id()); + } + devices.erase(pos, end(devices)); }