aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/qml/ftw/qqmlthread.cpp15
-rw-r--r--src/qml/qml/ftw/qqmlthread_p.h2
-rw-r--r--src/qml/qml/qqmltypeloader.cpp2
3 files changed, 13 insertions, 6 deletions
diff --git a/src/qml/qml/ftw/qqmlthread.cpp b/src/qml/qml/ftw/qqmlthread.cpp
index 397b4851cf..18b257dc0e 100644
--- a/src/qml/qml/ftw/qqmlthread.cpp
+++ b/src/qml/qml/ftw/qqmlthread.cpp
@@ -207,12 +207,6 @@ void QQmlThreadPrivate::threadEvent()
QQmlThread::QQmlThread()
: d(new QQmlThreadPrivate(this))
{
- d->lock();
- d->start();
- d->wait();
- d->unlock();
- d->moveToThread(d);
-
}
QQmlThread::~QQmlThread()
@@ -220,6 +214,15 @@ QQmlThread::~QQmlThread()
delete d;
}
+void QQmlThread::startup()
+{
+ d->lock();
+ d->start();
+ d->wait();
+ d->unlock();
+ d->moveToThread(d);
+}
+
void QQmlThread::shutdown()
{
d->lock();
diff --git a/src/qml/qml/ftw/qqmlthread_p.h b/src/qml/qml/ftw/qqmlthread_p.h
index 995fcd4824..95d32d4fd2 100644
--- a/src/qml/qml/ftw/qqmlthread_p.h
+++ b/src/qml/qml/ftw/qqmlthread_p.h
@@ -60,6 +60,8 @@ class QQmlThread
public:
QQmlThread();
virtual ~QQmlThread();
+
+ void startup();
void shutdown();
bool isShutdown() const;
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