summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-04-10 03:00:30 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-04-10 03:00:30 +0200
commitaf1685e0454db37c2c208b2a213557c5cdb429f0 (patch)
tree8f6c983845ff5a8b6eecab758f9b8cfad58196e5
parent4eb1ba5918e5e8e70a1f7ba9e731d2572f37d340 (diff)
parent0c988e14a90f3e1579365dc3dc99fbdd02ac3d4c (diff)
downloadqtserialport-af1685e0454db37c2c208b2a213557c5cdb429f0.tar.gz
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I00feb61aa056d72bb0b3bedd13991c585303a0db
-rw-r--r--src/serialport/qserialport_win.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp
index f90a7ef..85dd8ee 100644
--- a/src/serialport/qserialport_win.cpp
+++ b/src/serialport/qserialport_win.cpp
@@ -691,15 +691,18 @@ inline bool QSerialPortPrivate::initialize(QIODevice::OpenMode mode)
return false;
}
- if ((eventMask & EV_RXCHAR) && !startAsyncCommunication())
- return false;
-
notifier = new QWinOverlappedIoNotifier(q);
QObjectPrivate::connect(notifier, &QWinOverlappedIoNotifier::notified,
this, &QSerialPortPrivate::_q_notified);
notifier->setHandle(handle);
notifier->setEnabled(true);
+ if ((eventMask & EV_RXCHAR) && !startAsyncCommunication()) {
+ delete notifier;
+ notifier = nullptr;
+ return false;
+ }
+
return true;
}