diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2021-01-26 20:45:02 +0200 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2021-01-27 17:28:44 +0200 |
commit | 821af41cf212a269083231d46833a2366ed99326 (patch) | |
tree | c24fc00d6866f076320c7c5bf06a6600d4c42cd4 /src/corelib/io/qprocess.cpp | |
parent | 4e60681c879a54cf5b34862a30e27c492ed36363 (diff) |
QProcess/Unix: simplify notifiers deactivation
To minimize code duplication, move the socket notifier deletion to the
closeChannel() function, where the pipe descriptor will be closed.
Change-Id: If75ba1c955c706ae6e2b3d9f53f7a25e4aa32fa7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'src/corelib/io/qprocess.cpp')
-rw-r--r-- | src/corelib/io/qprocess.cpp | 19 |
1 files changed, 1 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. |