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>
This commit is contained in:
parent
6c53f2528c
commit
5393ba970b
@ -39,12 +39,10 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
QWindowsPipeWriter::QWindowsPipeWriter(HANDLE pipe, QObject * parent)
|
QWindowsPipeWriter::QWindowsPipeWriter(HANDLE pipe, QObject * parent)
|
||||||
: QThread(parent),
|
: QThread(parent),
|
||||||
writePipe(INVALID_HANDLE_VALUE),
|
writePipe(pipe),
|
||||||
quitNow(false),
|
quitNow(false),
|
||||||
hasWritten(false)
|
hasWritten(false)
|
||||||
{
|
{
|
||||||
DuplicateHandle(GetCurrentProcess(), pipe, GetCurrentProcess(),
|
|
||||||
&writePipe, 0, FALSE, DUPLICATE_SAME_ACCESS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWindowsPipeWriter::~QWindowsPipeWriter()
|
QWindowsPipeWriter::~QWindowsPipeWriter()
|
||||||
@ -55,7 +53,6 @@ QWindowsPipeWriter::~QWindowsPipeWriter()
|
|||||||
lock.unlock();
|
lock.unlock();
|
||||||
if (!wait(30000))
|
if (!wait(30000))
|
||||||
terminate();
|
terminate();
|
||||||
CloseHandle(writePipe);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QWindowsPipeWriter::waitForWrite(int msecs)
|
bool QWindowsPipeWriter::waitForWrite(int msecs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user