From 248677c03ff5c52bc90fcc3ce81e2ba9f592653b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 11 Jan 2022 18:17:42 +0100 Subject: opentrack: only register handlers on dialog creation Issue: #1407 --- opentrack/main-window.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'opentrack') diff --git a/opentrack/main-window.cpp b/opentrack/main-window.cpp index 404f4067..6ded7919 100644 --- a/opentrack/main-window.cpp +++ b/opentrack/main-window.cpp @@ -676,9 +676,12 @@ static void show_module_settings(std::shared_ptr instance, if (!embed) { - if (instance) - ((*dialog).*register_fun)(&*instance); - QObject::connect(&*dialog, &BaseDialog::closing, win, [&] { dialog = nullptr; }); + if (fresh) + { + if (instance) + ((*dialog).*register_fun)(&*instance); + QObject::connect(&*dialog, &BaseDialog::closing, win, [&] { dialog = nullptr; }); + } if (show) show_window(*dialog, fresh); } -- cgit v1.2.3