summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2024-03-29 16:40:30 +0300
committerAlexander Golubev <fatzer2@gmail.com>2024-03-29 20:37:22 +0300
commitd42a73f06fe8e06622d292f5cebffa429499370d (patch)
tree32a21e3fb9adbc4656f586ec5de12bc15b0c3a92
parent3b9a744a7bfbf927259a65f6c1ad912b67145757 (diff)
downloadtqt3-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.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/kernel/qthread_unix.cpp b/src/kernel/qthread_unix.cpp
index 6a6f81b7..bac4ea1c 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