From: Daiwei Li Date: Fri, 23 Jan 2015 22:33:35 +0000 (-0800) Subject: Fix crash when invalidating qqmltypeloader X-Git-Tag: v5.5.90+alpha1~3^2~242^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da6360b85d311d94b8d19126286404c0cc8c76fe;p=platform%2Fupstream%2Fqtdeclarative.git Fix crash when invalidating qqmltypeloader Change-Id: I16db2ea9a6c25d26e2b803b9bb8d9ef7156e254d Reviewed-by: Gunnar Sletta Reviewed-by: Simon Hausmann --- diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 1b222fe..0ac1d7f 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -903,15 +903,18 @@ QQmlDataLoader::~QQmlDataLoader() void QQmlDataLoader::invalidate() { - for (NetworkReplies::Iterator iter = m_networkReplies.begin(); iter != m_networkReplies.end(); ++iter) - (*iter)->release(); - m_networkReplies.clear(); - if (m_thread) { shutdownThread(); delete m_thread; m_thread = 0; } + + // Need to delete the network replies after + // the loader thread is shutdown as it could be + // getting new replies while we clear them + for (NetworkReplies::Iterator iter = m_networkReplies.begin(); iter != m_networkReplies.end(); ++iter) + (*iter)->release(); + m_networkReplies.clear(); } void QQmlDataLoader::lock()