From c7ec07d40115bef849574c81d619b629af9434a9 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 12 Jul 2017 14:20:54 +0200 Subject: 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 --- src/corelib/io/qwindowspipewriter_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/io/qwindowspipewriter_p.h') 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; -- cgit v1.2.3