Skip to content

Commit

Permalink
[ui] Fix thread unsafe call to setListening from concurrent threads
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Jan 3, 2024
1 parent 83c9057 commit f0266bd
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
#include <ossia/network/common/network_logger.hpp>
#include <ossia/network/context.hpp>

#include <ossia-qt/invoke.hpp>
#include <ossia-qt/name_utils.hpp>

#include <boost/asio/io_service.hpp>
#include <boost/asio/post.hpp>

#include <QCoreApplication>
#include <QMenu>

#include <spdlog/sinks/sink.h>
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit f0266bd

Please sign in to comment.