From 1eb54209adca3ed93426598c1dcf51ca4ba675be Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Mon, 29 Mar 2010 13:34:36 +0200 Subject: QNAM HTTP: Fix invoking a method when being destructed right now Reviewed-by: Thiago Macieira --- src/network/access/qhttpnetworkconnectionchannel.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 1d8224c..0b97cbe 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -648,7 +648,8 @@ void QHttpNetworkConnectionChannel::allDone() close(); QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); } else if (alreadyPipelinedRequests.isEmpty()) { - QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); + if (qobject_cast(connection)) + QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); } } @@ -753,7 +754,8 @@ void QHttpNetworkConnectionChannel::handleStatus() } break; default: - QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); + if (qobject_cast(connection)) + QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); } } @@ -801,7 +803,8 @@ void QHttpNetworkConnectionChannel::closeAndResendCurrentRequest() requeueCurrentlyPipelinedRequests(); close(); resendCurrent = true; - QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); + if (qobject_cast(connection)) + QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); } bool QHttpNetworkConnectionChannel::isSocketBusy() const -- cgit v0.12