summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-05-13 00:54:01 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-05-14 03:05:02 (GMT)
commit608d39c9ffee622114d9bc178d5e8ad3d1eadfb5 (patch)
treea952fe56ccd5de344183af455cb4eb9d045276fa /tests/manual
parente75161c4d54406d137f34b9f54fed853c16a6269 (diff)
downloadQt-608d39c9ffee622114d9bc178d5e8ad3d1eadfb5.zip
Qt-608d39c9ffee622114d9bc178d5e8ad3d1eadfb5.tar.gz
Qt-608d39c9ffee622114d9bc178d5e8ad3d1eadfb5.tar.bz2
Cherry pick fix for MOBILITY-962 from Qt Mobility.
6ea1caf2babc68d366fb6d3dc215c1bb18a76368
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/bearerex/bearerex.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/manual/bearerex/bearerex.cpp b/tests/manual/bearerex/bearerex.cpp
index 19246a2..bf60dd1 100644
--- a/tests/manual/bearerex/bearerex.cpp
+++ b/tests/manual/bearerex/bearerex.cpp
@@ -300,8 +300,12 @@ SessionTab::SessionTab(QNetworkConfiguration* apNetworkConfiguration,
SessionTab::~SessionTab()
{
+ // Need to be nulled, because modal dialogs may return after destruction of this object and
+ // use already released resources.
delete m_NetworkSession;
+ m_NetworkSession = NULL;
delete m_http;
+ m_http = NULL;
}
void SessionTab::on_createQHttpButton_clicked()
@@ -551,10 +555,16 @@ void SessionTab::done(bool error)
msgBox.setText(QString("HTTP request finished successfully.\nReceived ")+QString::number(result.length())+QString(" bytes."));
}
msgBox.exec();
-
- sentRecDataLineEdit->setText(QString::number(m_NetworkSession->bytesWritten())+
- QString(" / ")+
- QString::number(m_NetworkSession->bytesReceived()));
+ // Check if the networksession still exists - it may have gone after returning from
+ // the modal dialog (in the case that app has been closed, and deleting QHttp will
+ // trigger the done() invokation).
+ if (m_NetworkSession) {
+ sentRecDataLineEdit->setText(QString::number(m_NetworkSession->bytesWritten())+
+ QString(" / ")+
+ QString::number(m_NetworkSession->bytesReceived()));
+ } else {
+ sentRecDataLineEdit->setText("Data amounts not available.");
+ }
}
// End of file