From f0266bd8448ebc834f844c4f3bb066d419048f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Wed, 3 Jan 2024 12:29:45 -0500 Subject: [PATCH] [ui] Fix thread unsafe call to setListening from concurrent threads --- .../score-lib-device/Device/Protocol/DeviceInterface.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/score-lib-device/Device/Protocol/DeviceInterface.cpp b/src/plugins/score-lib-device/Device/Protocol/DeviceInterface.cpp index dd2e2af178..e01060e127 100644 --- a/src/plugins/score-lib-device/Device/Protocol/DeviceInterface.cpp +++ b/src/plugins/score-lib-device/Device/Protocol/DeviceInterface.cpp @@ -14,11 +14,13 @@ #include #include +#include #include #include #include +#include #include #include @@ -969,7 +971,8 @@ void DeviceInterface::addressCreated(const ossia::net::parameter_base& addr) State::Address currentAddress = ToAddress(addr.get_node()); Device::AddressSettings as = ToAddressSettings(addr.get_node()); pathUpdated(currentAddress, as); - setListening(currentAddress, true); + ossia::qt::run_async( + qApp, [this, addr = currentAddress] { setListening(addr, true); }); } void DeviceInterface::addressUpdated(