diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_win.cpp | 10 | ||||
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_win_p.h | 7 | ||||
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 6 |
4 files changed, 15 insertions, 12 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index db66157a0e..c06af79cc7 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -2676,9 +2676,9 @@ QStringList QCoreApplication::libraryPaths() QStringList *app_libpaths = new QStringList; coreappdata()->app_libpaths.reset(app_libpaths); - const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH"); + QString libPathEnv = qEnvironmentVariable("QT_PLUGIN_PATH"); if (!libPathEnv.isEmpty()) { - QStringList paths = QFile::decodeName(libPathEnv).split(QDir::listSeparator(), QString::SkipEmptyParts); + QStringList paths = libPathEnv.split(QDir::listSeparator(), QString::SkipEmptyParts); for (QStringList::const_iterator it = paths.constBegin(); it != paths.constEnd(); ++it) { QString canonicalPath = QDir(*it).canonicalPath(); if (!canonicalPath.isEmpty() diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 343ed70196..685d765adb 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -95,7 +95,7 @@ class QEventDispatcherWin32Private; LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp); QEventDispatcherWin32Private::QEventDispatcherWin32Private() - : threadId(GetCurrentThreadId()), interrupt(false), closingDown(false), internalHwnd(0), + : threadId(GetCurrentThreadId()), interrupt(false), internalHwnd(0), getMessageHook(0), serialNumber(0), lastSerialNumber(0), sendPostedEventsWindowsTimerId(0), wakeUps(0), activateNotifiersPosted(false), winEventNotifierActivatedEvent(NULL) { @@ -552,7 +552,7 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags) wakeUp(); // trigger a call to sendPostedEvents() } - d->interrupt = false; + d->interrupt.store(false); emit awake(); bool canWait; @@ -568,7 +568,7 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags) pHandles = &d->winEventNotifierActivatedEvent; } QVarLengthArray<MSG> processedTimers; - while (!d->interrupt) { + while (!d->interrupt.load()) { MSG msg; bool haveMessage; @@ -649,7 +649,7 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags) // still nothing - wait for message or signalled objects canWait = (!retVal - && !d->interrupt + && !d->interrupt.load() && (flags & QEventLoop::WaitForMoreEvents)); if (canWait) { emit aboutToBlock(); @@ -1022,7 +1022,7 @@ void QEventDispatcherWin32::wakeUp() void QEventDispatcherWin32::interrupt() { Q_D(QEventDispatcherWin32); - d->interrupt = true; + d->interrupt.store(true); wakeUp(); } diff --git a/src/corelib/kernel/qeventdispatcher_win_p.h b/src/corelib/kernel/qeventdispatcher_win_p.h index 707bc79407..dbad2a5450 100644 --- a/src/corelib/kernel/qeventdispatcher_win_p.h +++ b/src/corelib/kernel/qeventdispatcher_win_p.h @@ -165,8 +165,7 @@ public: DWORD threadId; - bool interrupt; - bool closingDown; + QAtomicInt interrupt; // internal window handle used for socketnotifiers/timers/etc HWND internalHwnd; @@ -193,9 +192,11 @@ public: void postActivateSocketNotifiers(); void doWsaAsyncSelect(int socket, long event); + bool closingDown = false; + + bool winEventNotifierListModified = false; HANDLE winEventNotifierActivatedEvent; QList<QWinEventNotifier *> winEventNotifierList; - bool winEventNotifierListModified = false; void activateEventNotifier(QWinEventNotifier * wen); QList<MSG> queuedUserInputEvents; diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index e67b2306c2..3a3eb726fa 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -2175,8 +2175,10 @@ void QObject::removeEventFilter(QObject *obj) Note that entering and leaving a new event loop (e.g., by opening a modal dialog) will \e not perform the deferred deletion; for the object to be - deleted, the control must return to the event loop from which - deleteLater() was called. + deleted, the control must return to the event loop from which deleteLater() + was called. This does not apply to objects deleted while a previous, nested + event loop was still running: the Qt event loop will delete those objects + as soon as the new nested event loop starts. \b{Note:} It is safe to call this function more than once; when the first deferred deletion event is delivered, any pending events for the |