diff options
author | Albert Astals Cid <albert.astals@canonical.com> | 2014-03-13 17:09:39 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-19 10:13:00 +0100 |
commit | 354d3a17e2a772c467343a47f7b328ea8482f7fa (patch) | |
tree | 858013f8d1e3ce8f34d2508e7f02ca0730886c29 /src/qml/qml/qqmlincubator.cpp | |
parent | c9456432dc8f06da94c51fde8a834ce563d8843a (diff) |
Clear the chain of incubated objects in QQmlIncubatorPrivate::clear
Change-Id: I432310c0e6006d567fd59b4b1021a9e1538ef78f
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'src/qml/qml/qqmlincubator.cpp')
-rw-r--r-- | src/qml/qml/qqmlincubator.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp index 4c9c99f1f6..480e61b0f4 100644 --- a/src/qml/qml/qqmlincubator.cpp +++ b/src/qml/qml/qqmlincubator.cpp @@ -169,6 +169,20 @@ void QQmlIncubatorPrivate::clear() nextWaitingFor.remove(); waitingOnMe = 0; } + + // if we're waiting on any incubators then they should be cleared too. + while (waitingFor.first()) { + QQmlIncubator * i = static_cast<QQmlIncubatorPrivate*>(waitingFor.first())->q; + if (i) + i->clear(); + } + + bool guardOk = vmeGuard.isOK(); + + vmeGuard.clear(); + if (creator && guardOk) + creator->clear(); + creator.reset(0); } /*! @@ -562,20 +576,6 @@ void QQmlIncubator::clear() d->clear(); - // if we're waiting on any incubators then they should be cleared too. - while (d->waitingFor.first()) { - QQmlIncubator * i = static_cast<QQmlIncubatorPrivate*>(d->waitingFor.first())->q; - if (i) - i->clear(); - } - - bool guardOk = d->vmeGuard.isOK(); - - d->vmeGuard.clear(); - if (d->creator && guardOk) - d->creator->clear(); - d->creator.reset(0); - Q_ASSERT(d->compiledData == 0); Q_ASSERT(d->waitingOnMe.data() == 0); Q_ASSERT(d->waitingFor.isEmpty()); |