Reset TQThreadInstance::currentThread() value when destroying main thread

This assures that TQRegExp who checks if there is an active thread
through this interface won't try to access its already destroyed
TQThreadLocalStorage, which might happen during destruction of static
TQRegExp objects.

Bug: https://mirror.git.trinitydesktop.org/gitea/TDE/tqt3/issues/142
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
fix/various
Alexander Golubev 8 months ago
parent 34dbe21c8d
commit fa52f57da1

@ -183,6 +183,9 @@ void TQThreadInstance::finish( void * )
void TQThreadInstance::finishGuiThread(TQThreadInstance *d) {
TQThreadStorageData::finish( d->thread_storage );
d->thread_storage = 0;
// Let all others (namely TQRegExp) know that the main thread is no longer alive
setCurrentThread(0);
}
TQMutex *TQThreadInstance::mutex() const

Loading…
Cancel
Save