From 8e01d0feed376f5e93698fb820e224014d8d9532 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 15 Dec 2014 20:06:18 +0100 Subject: options: emit signals only outside mutex scope --- opentrack/options.hpp | 20 ++++++++++++-------- 1 file 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(); } -- cgit v1.2.3