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>
bb10
Edward Welbourne 2016-08-24 14:56:24 +02:00
parent 2f865adb16
commit 99d2e0f861
1 changed files with 4 additions and 2 deletions

View File

@ -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);
}