diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-06-01 08:25:19 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-06-01 10:35:08 +0000 |
commit | 795a1bf1171f2bd8288ced2a2c46590eff32073d (patch) | |
tree | e2f05a3a269344706f0b283b9605e869549de3a9 /src/qml/qml/qqmlincubator.cpp | |
parent | 89aa39faf2f44120eb8e22a3f1342e9287ce7305 (diff) |
Remove "external" usages of QQmlCompiledData::engine
This removes the last "user" of QQmlCompiledData apart from its circular usage.
Change-Id: I5383c9e7bba03617a1145cd43f52051848962013
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlincubator.cpp')
-rw-r--r-- | src/qml/qml/qqmlincubator.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp index eba93bfb1a..d0991f51fe 100644 --- a/src/qml/qml/qqmlincubator.cpp +++ b/src/qml/qml/qqmlincubator.cpp @@ -132,7 +132,7 @@ QQmlIncubationController *QQmlEngine::incubationController() const QQmlIncubatorPrivate::QQmlIncubatorPrivate(QQmlIncubator *q, QQmlIncubator::IncubationMode m) : q(q), status(QQmlIncubator::Null), mode(m), isAsynchronous(false), progress(Execute), - result(0), compiledData(0), waitingOnMe(0) + result(0), enginePriv(0), compiledData(0), waitingOnMe(0) { } @@ -146,7 +146,6 @@ void QQmlIncubatorPrivate::clear() if (next.isInList()) { next.remove(); Q_ASSERT(compiledData); - QQmlEnginePrivate *enginePriv = QQmlEnginePrivate::get(compiledData->engine); compiledData->release(); compiledData = 0; enginePriv->incubatorCount--; @@ -157,6 +156,7 @@ void QQmlIncubatorPrivate::clear() compiledData->release(); compiledData = 0; } + enginePriv = 0; if (!rootContext.isNull()) { rootContext->activeVMEData = 0; rootContext = 0; @@ -286,9 +286,8 @@ void QQmlIncubatorPrivate::incubate(QQmlInstantiationInterrupt &i) QExplicitlySharedDataPointer<QQmlIncubatorPrivate> protectThis(this); QRecursionWatcher<QQmlIncubatorPrivate, &QQmlIncubatorPrivate::recursion> watcher(this); - - QQmlEngine *engine = compiledData->engine; - QQmlEnginePrivate *enginePriv = QQmlEnginePrivate::get(engine); + // get a copy of the engine pointer as it might get reset; + QQmlEnginePrivate *enginePriv = this->enginePriv; if (!vmeGuard.isOK()) { QQmlError error; @@ -563,10 +562,9 @@ void QQmlIncubator::clear() if (s == Null) return; - QQmlEnginePrivate *enginePriv = 0; + QQmlEnginePrivate *enginePriv = d->enginePriv; if (s == Loading) { Q_ASSERT(d->compiledData); - enginePriv = QQmlEnginePrivate::get(d->compiledData->engine); if (d->result) d->result->deleteLater(); d->result = 0; } |