From 579de8ec4eb22c4577bf1cfc8caba47c320506e3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 19 Oct 2021 14:04:13 +0200 Subject: options: run reload() handlers in ui thread --- options/scoped.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/options/scoped.cpp b/options/scoped.cpp index 9cbc826c..00f30be7 100644 --- a/options/scoped.cpp +++ b/options/scoped.cpp @@ -1,4 +1,5 @@ #include "scoped.hpp" +#include "compat/run-in-thread.hpp" #include #include @@ -48,7 +49,12 @@ static bool is_tracker_teardown() opts::~opts() { if (!is_tracker_teardown() && raii) +#if 1 + run_in_thread_sync(qApp->thread(), [this]{ b->reload(); }); +#else + assert(b); b->reload(); +#endif #if 0 else qDebug() << "in teardown, not reloading" << b->name(); -- cgit v1.2.3