summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-07-03 22:32:50 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-07-07 05:22:33 +0000
commit8b5cdc20be5df287f61fce25998bb5dc4bcf73fb (patch)
tree3657d7c45daa493524ee994767e2e963101e574c /src/corelib/io/qprocess.cpp
parent6aa89ddf5e30bf3a0b3814140872b71cfbae9796 (diff)
QProcessEnvironment: fix op==
Not all empty states were considered equal. [ChangeLog][QtCore][QProcessEnvironment] Fixed a bug in operator== involving different empty states. Change-Id: I13c3200897847475bde2f963db0d2c587336b8a7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qprocess.cpp')
-rw-r--r--src/corelib/io/qprocess.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 218e8b959c..8a1fda6ccb 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -264,11 +264,16 @@ bool QProcessEnvironment::operator==(const QProcessEnvironment &other) const
{
if (d == other.d)
return true;
- if (d && other.d) {
- QProcessEnvironmentPrivate::OrderedMutexLocker locker(d, other.d);
- return d->hash == other.d->hash;
+ if (d) {
+ if (other.d) {
+ QProcessEnvironmentPrivate::OrderedMutexLocker locker(d, other.d);
+ return d->hash == other.d->hash;
+ } else {
+ return isEmpty();
+ }
+ } else {
+ return other.isEmpty();
}
- return false;
}
/*!