summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDyami Caliri <dyami@dragonframe.com>2015-06-03 11:46:58 -0700
committerDyami Caliri <dyami@dragonframe.com>2015-06-06 03:07:35 +0000
commit2d8c7087fb9ab747e9cae4a246685a6563db1d78 (patch)
treefe2c7157877c9e3df4763df34c8185bbfd9c23f8
parentf54a3d783e51d424b7d8aeff4734f01865437971 (diff)
Fix race condition with QProcess on OSX 10.7
Closing the forkfd descriptor before disabling the deathNotifier causes a race condition in ~QProcess. This is the same underlying cause as QTBUG-22789. Change-Id: I1cbdedc567fdfa8d95d111827b7bf9994661ecc7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/io/qprocess_unix.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 69b631f7e7..0fc9464f52 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -1101,6 +1101,9 @@ bool QProcessPrivate::waitForDeadChild()
exitCode = info.si_status;
crashed = info.si_code != CLD_EXITED;
+ delete deathNotifier;
+ deathNotifier = 0;
+
qt_safe_close(forkfd);
forkfd = -1; // Child is dead, don't try to kill it anymore