summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--options/scoped.cpp2
-rw-r--r--options/scoped.hpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/options/scoped.cpp b/options/scoped.cpp
index f5e219e2..9cbc826c 100644
--- a/options/scoped.cpp
+++ b/options/scoped.cpp
@@ -47,7 +47,7 @@ static bool is_tracker_teardown()
opts::~opts()
{
- if (!is_tracker_teardown())
+ if (!is_tracker_teardown() && raii)
b->reload();
#if 0
else
diff --git a/options/scoped.hpp b/options/scoped.hpp
index dd7dbacf..81e6bd19 100644
--- a/options/scoped.hpp
+++ b/options/scoped.hpp
@@ -27,9 +27,13 @@ struct OTR_OPTIONS_EXPORT opts
opts& operator=(const opts&) = delete;
opts(const opts&) = delete;
+ void set_raii_dtor_state(bool x) { raii = x; }
+
protected:
explicit opts(const QString& name);
~opts();
+private:
+ bool raii = true;
};
}