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>
This commit is contained in:
Dyami Caliri 2015-06-03 11:46:58 -07:00
parent f54a3d783e
commit 2d8c7087fb

View File

@ -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