From 2a6a33767f7068fc5c43bc03f66df6329fc3cea6 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 15 Sep 2014 16:57:35 +0200 Subject: Don't start QQmlThreads from their constructor In the case of derived classes (like the only user of QQmlThread) we cannot guarantee that the class is completely constructed when the thread starts. This includes the vtable which is necessary to decide which virtual functions to call. Change-Id: Ieaea67a72cc3b4f845b8621b34ca2928185917fb Reviewed-by: Simon Hausmann --- src/qml/qml/qqmltypeloader.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/qml/qml/qqmltypeloader.cpp') diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 0b7cc8e911..0e2d4d027a 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -728,6 +728,8 @@ void QQmlDataBlob::ThreadData::setProgress(quint8 v) QQmlDataLoaderThread::QQmlDataLoaderThread(QQmlDataLoader *loader) : m_loader(loader), m_networkAccessManager(0), m_networkReplyProxy(0) { + // Do that after initializing all the members. + startup(); } QNetworkAccessManager *QQmlDataLoaderThread::networkAccessManager() const -- cgit v1.2.3