diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-10-15 23:58:49 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-10-16 18:20:50 +0200 |
commit | 6d953ab8a790312c46c04264a328741c949ad830 (patch) | |
tree | 93e3b5f6776efa48ff6dfad74ac4ea0e4c89ff72 | |
parent | b9a4d906f1cde54ba05dd8be8d4971f0fa51d98e (diff) |
options/opts: allow disable raii guard
-rw-r--r-- | options/scoped.cpp | 2 | ||||
-rw-r--r-- | options/scoped.hpp | 4 |
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; }; } |