diff options
author | Alexander Golubev <fatzer2@gmail.com> | 2024-03-29 16:40:30 +0300 |
---|---|---|
committer | Alexander Golubev <fatzer2@gmail.com> | 2024-03-29 20:37:22 +0300 |
commit | d42a73f06fe8e06622d292f5cebffa429499370d (patch) | |
tree | 32a21e3fb9adbc4656f586ec5de12bc15b0c3a92 | |
parent | 3b9a744a7bfbf927259a65f6c1ad912b67145757 (diff) | |
download | tqt3-fix/issue/142-r1.tar.gz tqt3-fix/issue/142-r1.zip |
Reset TQThreadInstance::currentThread() value when destroying main threadfix/issue/142-r1
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
-rw-r--r-- | src/kernel/qthread_unix.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/kernel/qthread_unix.cpp b/src/kernel/qthread_unix.cpp index 6a6f81b7f..bac4ea1ce 100644 --- a/src/kernel/qthread_unix.cpp +++ b/src/kernel/qthread_unix.cpp @@ -183,6 +183,10 @@ void TQThreadInstance::finish( void * ) void TQThreadInstance::finishGuiThread(TQThreadInstance *d) { TQThreadStorageData::finish( d->thread_storage ); d->thread_storage = 0; + + // You should use TQApplication::currentThread() to check if GUI thread wasn't yet destroyed, + // but just in case we better cleanup the pointer here as well. + setCurrentThread(0); } TQMutex *TQThreadInstance::mutex() const |