diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp index 4e5cf05aef4..1e11c9cd96a 100644 --- a/src/network/access/qhttpthreaddelegate.cpp +++ b/src/network/access/qhttpthreaddelegate.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "private/qhttpnetworkreply_p.h" #include "private/qnetworkaccesscache_p.h" @@ -215,7 +216,7 @@ void QHttpThreadDelegate::startRequestSynchronously() synchronous = true; QEventLoop synchronousRequestLoop; - this->synchronousRequestLoop = &synchronousRequestLoop; + QScopedValueRollback guard(this->synchronousRequestLoop, &synchronousRequestLoop); // Worst case timeout QTimer::singleShot(30*1000, this, SLOT(abortRequest()));