summaryrefslogtreecommitdiffhomepage
path: root/options
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-10-17 13:39:32 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-10-17 15:20:01 +0200
commit2f10b3ad8cb8c5d34a27716f26b4a6bea0d75add (patch)
tree1312d5958dfc0dea9ab6cdc3cdf7eebf75aca83c /options
parent534826df280cd607d7f85afd4092d47379fb4886 (diff)
options/connector: fix deadlock
Diffstat (limited to 'options')
-rw-r--r--options/connector.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/options/connector.cpp b/options/connector.cpp
index 40c99a82..e86958f7 100644
--- a/options/connector.cpp
+++ b/options/connector.cpp
@@ -64,6 +64,8 @@ void connector::on_value_created(value_type val)
void connector::notify_values(const QString& name) const
{
+ QMutexLocker l(get_mtx());
+
auto it = connected_values.find(name);
if (it != connected_values.cend())
for (value_type val : it->second)
@@ -72,6 +74,8 @@ void connector::notify_values(const QString& name) const
void connector::notify_all_values() const
{
+ QMutexLocker l(get_mtx());
+
for (const auto& [k, v] : connected_values)
for (value_type val : v)
val->notify();
@@ -79,6 +83,8 @@ void connector::notify_all_values() const
void connector::set_all_to_default_()
{
+ QMutexLocker l(get_mtx());
+
for (auto& pair : connected_values)
for (auto& val : pair.second)
val->set_to_default();