summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/io/qprocess.cpp19
-rw-r--r--src/corelib/io/qprocess_unix.cpp3
2 files changed, 4 insertions, 18 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 05aa0f021f..8b26e845a8 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -867,18 +867,6 @@ void QProcessPrivate::cleanup()
pid = 0;
#endif
- if (stdoutChannel.notifier) {
- delete stdoutChannel.notifier;
- stdoutChannel.notifier = nullptr;
- }
- if (stderrChannel.notifier) {
- delete stderrChannel.notifier;
- stderrChannel.notifier = nullptr;
- }
- if (stdinChannel.notifier) {
- delete stdinChannel.notifier;
- stdinChannel.notifier = nullptr;
- }
if (stateNotifier) {
delete stateNotifier;
stateNotifier = nullptr;
@@ -1052,8 +1040,6 @@ bool QProcessPrivate::tryReadFromChannel(Channel *channel)
}
if (readBytes == 0) {
// EOF
- if (channel->notifier)
- channel->notifier->setEnabled(false);
closeChannel(channel);
#if defined QPROCESS_DEBUG
qDebug("QProcessPrivate::tryReadFromChannel(%d), 0 bytes available",
@@ -1224,10 +1210,7 @@ void QProcessPrivate::closeWriteChannel()
#if defined QPROCESS_DEBUG
qDebug("QProcessPrivate::closeWriteChannel()");
#endif
- if (stdinChannel.notifier) {
- delete stdinChannel.notifier;
- stdinChannel.notifier = nullptr;
- }
+
#ifdef Q_OS_WIN
// ### Find a better fix, feeding the process little by little
// instead.
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 2f21e0ee1e..712fe2a5d9 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -216,6 +216,9 @@ void QProcessPrivate::destroyPipe(int *pipe)
void QProcessPrivate::closeChannel(Channel *channel)
{
+ delete channel->notifier;
+ channel->notifier = nullptr;
+
destroyPipe(channel->pipe);
}