QProcess: do not emit aboutToClose() twice
This signal is emitted by the QIODevice itself, so we don't have to emit it from QProcess::close(). Change-Id: I9165b3eebadc17a66cc834d5ef54441d13f23d7d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit efb90f6e7ed3e8d4f7b6c0fb96012cb3a9a9d037) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
7b930750b1
commit
4a6618ca68
@ -1669,7 +1669,6 @@ qint64 QProcess::processId() const
|
||||
void QProcess::close()
|
||||
{
|
||||
Q_D(QProcess);
|
||||
emit aboutToClose();
|
||||
while (waitForBytesWritten(-1))
|
||||
;
|
||||
kill();
|
||||
|
@ -835,6 +835,7 @@ void tst_QProcess::closeReadChannel()
|
||||
void tst_QProcess::openModes()
|
||||
{
|
||||
QProcess proc;
|
||||
QSignalSpy spyAboutToClose(&proc, &QProcess::aboutToClose);
|
||||
QVERIFY(!proc.isOpen());
|
||||
QCOMPARE(proc.openMode(), QProcess::NotOpen);
|
||||
proc.start("testProcessEcho3/testProcessEcho3");
|
||||
@ -870,6 +871,7 @@ void tst_QProcess::openModes()
|
||||
QVERIFY(!proc.isOpen());
|
||||
QVERIFY(!proc.isReadable());
|
||||
QVERIFY(!proc.isWritable());
|
||||
QCOMPARE(spyAboutToClose.count(), 1);
|
||||
QCOMPARE(proc.state(), QProcess::NotRunning);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user