diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 0311b8e3845..5a366538d21 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -244,7 +244,7 @@ static void set_thread_data(QThreadData *data) noexcept // As noted above: one global static for the thread that called // ::exit() (which may not be a Qt thread) and the pthread_key_t for // all others. - QThreadDataDestroyer::EarlyMainThread currentThreadCleanup; + static QThreadDataDestroyer::EarlyMainThread currentThreadCleanup; pthread_setspecific(threadDataDestroyer.key, data); } currentThreadData = data;