summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qeventdispatcher_win.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-18 20:45:53 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-18 20:50:35 +0100
commit4fe2fbcf827ae6bec976b0b8dcaa5d14bd05dc33 (patch)
treed1ba753b45b09b417a9447ebdfe2fa6fc47dba69 /src/corelib/kernel/qeventdispatcher_win.cpp
parentc1da6347e8d3ba73de20ab8fb3e50ec3359b75ac (diff)
parent4889269ff0fb37130b332863e82dd7c19564116c (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_win.cpp')
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 73cefdafd7..4d7aa83c43 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -942,9 +942,8 @@ void QEventDispatcherWin32::registerSocketNotifier(QSocketNotifier *notifier)
void QEventDispatcherWin32::unregisterSocketNotifier(QSocketNotifier *notifier)
{
Q_ASSERT(notifier);
- int sockfd = notifier->socket();
- int type = notifier->type();
#ifndef QT_NO_DEBUG
+ int sockfd = notifier->socket();
if (sockfd < 0) {
qWarning("QSocketNotifier: Internal error");
return;
@@ -953,8 +952,16 @@ void QEventDispatcherWin32::unregisterSocketNotifier(QSocketNotifier *notifier)
return;
}
#endif
+ doUnregisterSocketNotifier(notifier);
+}
+void QEventDispatcherWin32::doUnregisterSocketNotifier(QSocketNotifier *notifier)
+{
Q_D(QEventDispatcherWin32);
+ int type = notifier->type();
+ int sockfd = notifier->socket();
+ Q_ASSERT(sockfd >= 0);
+
QSFDict::iterator it = d->active_fd.find(sockfd);
if (it != d->active_fd.end()) {
QSockFd &sd = it.value();
@@ -1210,11 +1217,11 @@ void QEventDispatcherWin32::closingDown()
// clean up any socketnotifiers
while (!d->sn_read.isEmpty())
- unregisterSocketNotifier((*(d->sn_read.begin()))->obj);
+ doUnregisterSocketNotifier((*(d->sn_read.begin()))->obj);
while (!d->sn_write.isEmpty())
- unregisterSocketNotifier((*(d->sn_write.begin()))->obj);
+ doUnregisterSocketNotifier((*(d->sn_write.begin()))->obj);
while (!d->sn_except.isEmpty())
- unregisterSocketNotifier((*(d->sn_except.begin()))->obj);
+ doUnregisterSocketNotifier((*(d->sn_except.begin()))->obj);
Q_ASSERT(d->active_fd.isEmpty());
// clean up any timers