summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2016-08-24 14:56:24 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2016-08-25 07:59:41 +0000
commit99d2e0f8616c69bb685ab51d4766095e7e3f27eb (patch)
tree9a749d5a529a2dcdf35a3cb67749fcc124b454dc /tests
parent2f865adb16c462b25012006f55668e5c2807065e (diff)
tst_qnetworkreply: condition dereferencing on non-null
The (event) loop member spends most of its time NULL, so make sure slots that dereference it can't trip up if called asynchronously when it is. Change-Id: If634df0ecf9650b52621bdb5a3e9f151abbc18fc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 29b3a3e026..6fad7cbc0b 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -1456,12 +1456,14 @@ int tst_QNetworkReply::waitForFinish(QNetworkReplyPtr &reply)
void tst_QNetworkReply::finished()
{
- loop->exit(returnCode = Success);
+ if (loop)
+ loop->exit(returnCode = Success);
}
void tst_QNetworkReply::gotError()
{
- loop->exit(returnCode = Failure);
+ if (loop)
+ loop->exit(returnCode = Failure);
disconnect(QObject::sender(), SIGNAL(finished()), this, 0);
}