diff options
author | Volker Krause <vkrause@kde.org> | 2022-01-21 16:01:35 +0100 |
---|---|---|
committer | Volker Krause <vkrause@kde.org> | 2022-01-22 12:35:06 +0100 |
commit | 41d37407e80f5ccd110cf303c20a181f95fa7e73 (patch) | |
tree | bc343cd6335934f9be8be7855d9398c32b35bcd3 /autotests/kconfig_compiler/test10.cpp.ref | |
parent | 3bbe9de5d59a6572f3549cc3a553dd44db421b68 (diff) | |
download | kconfig-41d37407e80f5ccd110cf303c20a181f95fa7e73.tar.gz kconfig-41d37407e80f5ccd110cf303c20a181f95fa7e73.tar.bz2 |
Make singleton teardown work with Qt6 as well
In Qt6 the Q_GLOBAL_STATIC will already report to be null while it is in
the process of being deleted, we therefore cannot access it anymore from
destruction code path as we did before.
This problem is hit for example by the Breeze style, making all 6 based
widgets applications crash on exit without this.
Diffstat (limited to 'autotests/kconfig_compiler/test10.cpp.ref')
-rw-r--r-- | autotests/kconfig_compiler/test10.cpp.ref | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/autotests/kconfig_compiler/test10.cpp.ref b/autotests/kconfig_compiler/test10.cpp.ref index 94d9f311..2369d2c3 100644 --- a/autotests/kconfig_compiler/test10.cpp.ref +++ b/autotests/kconfig_compiler/test10.cpp.ref @@ -10,7 +10,7 @@ class Test10Helper { public: Test10Helper() : q(nullptr) {} - ~Test10Helper() { delete q; } + ~Test10Helper() { delete q; q = nullptr; } Test10Helper(const Test10Helper&) = delete; Test10Helper& operator=(const Test10Helper&) = delete; Test10 *q; @@ -43,6 +43,8 @@ Test10::Test10( ) Test10::~Test10() { - s_globalTest10()->q = nullptr; + if (s_globalTest10.exists() && !s_globalTest10.isDestroyed()) { + s_globalTest10()->q = nullptr; + } } |