From 5393ba970b0d25280a048ef31c3ffd2e5efe0320 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Date: Wed, 10 Jun 2015 16:45:02 +0200 Subject: [PATCH] Remove handle duplication code from QWindowsPipeWriter There is no apparent reason why the handle should be duplicated. Change-Id: I8ff2cde2f050934ed0dd9ab2d39a1b1efa327a17 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> --- src/corelib/io/qwindowspipewriter.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp index 21df5d06434..5b11ba6112a 100644 --- a/src/corelib/io/qwindowspipewriter.cpp +++ b/src/corelib/io/qwindowspipewriter.cpp @@ -39,12 +39,10 @@ QT_BEGIN_NAMESPACE QWindowsPipeWriter::QWindowsPipeWriter(HANDLE pipe, QObject * parent) : QThread(parent), - writePipe(INVALID_HANDLE_VALUE), + writePipe(pipe), quitNow(false), hasWritten(false) { - DuplicateHandle(GetCurrentProcess(), pipe, GetCurrentProcess(), - &writePipe, 0, FALSE, DUPLICATE_SAME_ACCESS); } QWindowsPipeWriter::~QWindowsPipeWriter() @@ -55,7 +53,6 @@ QWindowsPipeWriter::~QWindowsPipeWriter() lock.unlock(); if (!wait(30000)) terminate(); - CloseHandle(writePipe); } bool QWindowsPipeWriter::waitForWrite(int msecs) -- GitLab