summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_unix.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-24 15:14:55 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-24 15:14:55 +0200
commit88211af86c3fe447041cfa1aa7be27da86dc84af (patch)
treede1e4f9bb41432bc3dadc7ed82429fd02bf39a3c /src/corelib/thread/qthread_unix.cpp
parent687f002352a02f190591c10fded61b2e566f521e (diff)
parent6213b8145772d3dc584907a544f6c46b8cef74e2 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib/thread/qthread_unix.cpp')
-rw-r--r--src/corelib/thread/qthread_unix.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index f123e1813b..be9b946990 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -172,6 +172,12 @@ static void destroy_current_thread_data_key()
{
pthread_once(&current_thread_data_once, create_current_thread_data_key);
pthread_key_delete(current_thread_data_key);
+
+ // Reset current_thread_data_once in case we end up recreating
+ // the thread-data in the rare case of QObject construction
+ // after destroying the QThreadData.
+ pthread_once_t pthread_once_init = PTHREAD_ONCE_INIT;
+ current_thread_data_once = pthread_once_init;
}
Q_DESTRUCTOR_FUNCTION(destroy_current_thread_data_key)