[*] fix more halfbrained qt crap
"nooo what is this? a thread that my stupid spurious branch somewhere under the qobject ctor didnt catch." "nooo you mustn't have control over your programs execution, only the gui kernel can handle exec! its very important we have this one flag set before loop... see: we check it in two places to specifically ensure you aren't using qt the way you want. fuck you that's why." "nooo we know better than c devs, xyz isnt possible or is a hack. btw lets stringify macro tokens for uids and autogenerate virtual methods, gaslight people into denying the existence of methods, and then force an entire retarded toolchain down peoples throat to craft a simple c++ object" b-but dont you know, this pile of steaming shit is a legacy "industry driven/tested" codebase. rationalize it how you want, Qts codebase stinks to high hell.
This commit is contained in:
parent
01755f7ce7
commit
cdb97232a9
@ -470,9 +470,14 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
|
||||
qFatal("FATAL: The application binary appears to be running setuid, this is a security hole.");
|
||||
# endif // Q_OS_UNIX
|
||||
|
||||
#ifdef Q_OS_WINRT
|
||||
// Turns out Qt, under Win32 and Qt's idea of a "Unix" platform, sets the main thread by deciding spurious qobject creation is indicative main thread init
|
||||
// I'm including Unix here because, guess what, there's no TLS order guarantees and they're using thread_local in multiple places.
|
||||
// Their brain dead solution: if winrt here, then we must be the main thread
|
||||
// No, just fucking no.
|
||||
|
||||
//#ifdef Q_OS_WINRT
|
||||
QThreadData::setMainThread();
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
QThread *cur = QThread::currentThread(); // note: this may end up setting theMainThread!
|
||||
if (cur != theMainThread.loadAcquire())
|
||||
|
@ -52,6 +52,8 @@
|
||||
#include <private/qeventdispatcher_winrt_p.h>
|
||||
#endif
|
||||
|
||||
#include "../kernel/qthreadawareeventdispatcher_i.hpp"
|
||||
|
||||
#include <qt_windows.h>
|
||||
|
||||
#ifndef Q_OS_WINRT
|
||||
@ -142,15 +144,9 @@ QThreadData *QThreadData::current(bool createIfNecessary)
|
||||
threadData->isAdopted = true;
|
||||
threadData->threadId.storeRelaxed(reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId())));
|
||||
|
||||
#ifndef Q_OS_WINRT
|
||||
if (!QCoreApplicationPrivate::theMainThread) {
|
||||
QCoreApplicationPrivate::theMainThread = threadData->thread.loadRelaxed();
|
||||
} else {
|
||||
#else
|
||||
// for winrt the main thread is set explicitly in QCoreApplication's constructor as the
|
||||
// native main thread (Xaml thread) is not Qt's main thread.
|
||||
{
|
||||
#endif
|
||||
HANDLE realHandle = INVALID_HANDLE_VALUE;
|
||||
DuplicateHandle(GetCurrentProcess(),
|
||||
GetCurrentThread(),
|
||||
@ -427,7 +423,10 @@ void QThreadPrivate::finish(void *arg, bool lockAnyway) noexcept
|
||||
d->data->eventDispatcher = 0;
|
||||
locker.unlock();
|
||||
eventDispatcher->closingDown();
|
||||
delete eventDispatcher;
|
||||
if (gGlobalEventDispatcher != eventDispatcher)
|
||||
{
|
||||
delete eventDispatcher;
|
||||
}
|
||||
locker.relock();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user