summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-12-15 20:06:18 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-12-15 20:06:18 +0100
commit8e01d0feed376f5e93698fb820e224014d8d9532 (patch)
treec17550259c2b9cb6f3ef2afa4dbf11ea0e210a90
parent41fb19a8317ec7a5c8ce323220fb70340c16d529 (diff)
options: emit signals only outside mutex scope
-rw-r--r--opentrack/options.hpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/opentrack/options.hpp b/opentrack/options.hpp
index 7eeda198..16760df5 100644
--- a/opentrack/options.hpp
+++ b/opentrack/options.hpp
@@ -167,10 +167,12 @@ namespace options {
string name() { return group_name; }
void reload() {
- QMutexLocker l(&mtx);
- saved = group(group_name);
- transient = saved;
- modified = false;
+ {
+ QMutexLocker l(&mtx);
+ saved = group(group_name);
+ transient = saved;
+ modified = false;
+ }
emit reloading();
}
@@ -198,10 +200,12 @@ namespace options {
}
void save()
{
- QMutexLocker l(&mtx);
- modified = false;
- saved = transient;
- transient.save();
+ {
+ QMutexLocker l(&mtx);
+ modified = false;
+ saved = transient;
+ transient.save();
+ }
emit saving();
}