diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-07-12 14:20:54 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-07-17 11:20:47 +0000 |
commit | c7ec07d40115bef849574c81d619b629af9434a9 (patch) | |
tree | b794a497d90794719a311b6f86f3e62372771bb1 /src/corelib/io/qwindowspipewriter_p.h | |
parent | 0345608d169d7c59768e461a9ec61bb7563cbaa6 (diff) |
Do not wait in QWindowsPipe{Reader|Writer}::stop()
A deadlock can occur if the user does
QLocalSocket *ls = new QLocalSocket;
ls->moveToThread(t);
...
delete ls;
Then QLocalSocket calls QWindowsPipeReader::stop() in a different thread
than the I/O operation is running in. The waitForNotified(-1) call would
then wait indefinitely until the I/O thread is in alertable wait state
again. Especially on application shut down this might never be the case,
and the application would deadlock.
Solve this by detaching the Overlapped object from the
QWindowsPipe{Reader|Writer} in stop() and delete it in the callback.
Task-number: QTBUG-61643
Change-Id: Ie262d75c5fd92ac7cf7dfcdbf1519050be9fd3c4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/corelib/io/qwindowspipewriter_p.h')
-rw-r--r-- | src/corelib/io/qwindowspipewriter_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qwindowspipewriter_p.h b/src/corelib/io/qwindowspipewriter_p.h index c43e986f34..c8252e2a4b 100644 --- a/src/corelib/io/qwindowspipewriter_p.h +++ b/src/corelib/io/qwindowspipewriter_p.h @@ -143,7 +143,7 @@ private: }; HANDLE handle; - Overlapped overlapped; + Overlapped *overlapped; QByteArray buffer; qint64 numberOfBytesToWrite; qint64 pendingBytesWrittenValue; |