diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/compiler/qv4jsir.cpp | 8 | ||||
-rw-r--r-- | src/qml/doc/src/qmltypereference.qdoc | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlcomponent.cpp | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmlcomponent_p.h | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 9 | ||||
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 26 | ||||
-rw-r--r-- | src/qml/qml/qqmlobjectcreator_p.h | 18 | ||||
-rw-r--r-- | src/quick/doc/src/qmltypereference.qdoc | 8 | ||||
-rw-r--r-- | src/quick/items/qquickflickable_p_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 2 |
12 files changed, 64 insertions, 26 deletions
diff --git a/src/qml/compiler/qv4jsir.cpp b/src/qml/compiler/qv4jsir.cpp index 9a1a8bab42..aa3769be46 100644 --- a/src/qml/compiler/qv4jsir.cpp +++ b/src/qml/compiler/qv4jsir.cpp @@ -749,6 +749,11 @@ void BasicBlock::setStatements(const QVector<Stmt *> &newStatements) { Q_ASSERT(!isRemoved()); Q_ASSERT(newStatements.size() >= _statements.size()); + // FIXME: this gets quite inefficient for large basic-blocks, so this function/case should be re-worked. + foreach (Stmt *s, _statements) { + if (!newStatements.contains(s)) + s->destroyData(); + } _statements = newStatements; } @@ -788,18 +793,21 @@ void BasicBlock::insertStatementBeforeTerminator(Stmt *stmt) void BasicBlock::replaceStatement(int index, Stmt *newStmt) { Q_ASSERT(!isRemoved()); + _statements[index]->destroyData(); _statements[index] = newStmt; } void BasicBlock::removeStatement(Stmt *stmt) { Q_ASSERT(!isRemoved()); + stmt->destroyData(); _statements.remove(_statements.indexOf(stmt)); } void BasicBlock::removeStatement(int idx) { Q_ASSERT(!isRemoved()); + _statements[idx]->destroyData(); _statements.remove(idx); } diff --git a/src/qml/doc/src/qmltypereference.qdoc b/src/qml/doc/src/qmltypereference.qdoc index 61d4e67acb..0f98773b70 100644 --- a/src/qml/doc/src/qmltypereference.qdoc +++ b/src/qml/doc/src/qmltypereference.qdoc @@ -55,7 +55,7 @@ are also provided by the \c QtQuick namespace which may be imported as follows: \qml -import QtQuick 2.2 +import QtQuick 2.3 \endqml See the \l{Qt Quick} module documentation for more information about the \c diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 37956825f8..5915f2d039 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -971,6 +971,8 @@ static void markChildQObjectsRecursively(QObject *parent, QV4::ExecutionEngine * const QObjectList &children = parent->children(); for (int i = 0; i < children.count(); ++i) { QObject *child = children.at(i); + if (!child) + continue; QQmlData *ddata = QQmlData::get(child, /*create*/false); if (ddata) ddata->jsWrapper.markOnce(e); diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index c247c7f5a6..d44b918abe 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -150,7 +150,7 @@ V8_DEFINE_EXTENSION(QQmlComponentExtension, componentExtension); // QQmlEngine *engine = qmlContext(this)->engine(); QQmlComponent component(engine, QUrl::fromLocalFile("MyItem.qml")); QQuickItem *childItem = qobject_cast<QQuickItem*>(component.create()); - childItem->setParent(this); + childItem->setParentItem(this); } \endcode @@ -880,7 +880,7 @@ QQmlComponentPrivate::beginCreate(QQmlContextData *context) enginePriv->referenceScarceResources(); QObject *rv = 0; - state.creator = new QQmlObjectCreator(context, cc, creationContext); + state.creator.reset(new QQmlObjectCreator(context, cc, creationContext)); rv = state.creator->create(start); if (!rv) state.errors = state.creator->errors; @@ -920,7 +920,7 @@ void QQmlComponentPrivate::beginDeferred(QQmlEnginePrivate *enginePriv, Q_ASSERT(ddata->deferredData); QQmlData::DeferredData *deferredData = ddata->deferredData; QQmlContextData *creationContext = 0; - state->creator = new QQmlObjectCreator(deferredData->context->parent, deferredData->compiledData, creationContext); + state->creator.reset(new QQmlObjectCreator(deferredData->context->parent, deferredData->compiledData, creationContext)); if (!state->creator->populateDeferredProperties(object)) state->errors << state->creator->errors; } diff --git a/src/qml/qml/qqmlcomponent_p.h b/src/qml/qml/qqmlcomponent_p.h index e8ae540148..2c70d7b100 100644 --- a/src/qml/qml/qqmlcomponent_p.h +++ b/src/qml/qml/qqmlcomponent_p.h @@ -106,15 +106,13 @@ public: struct ConstructionState { ConstructionState() - : creator(0) - , completePending(false) + : completePending(false) {} ~ConstructionState() { - delete creator; } - QQmlObjectCreator *creator; + QScopedPointer<QQmlObjectCreator> creator; QList<QQmlError> errors; bool completePending; }; diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 61246b92d8..17e5c55efb 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -2306,20 +2306,17 @@ static inline QString shellNormalizeFileName(const QString &name) // The correct declaration of the SHGetPathFromIDList symbol is // being used in mingw-w64 as of r6215, which is a v3 snapshot. #if defined(Q_CC_MINGW) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 3) - ITEMIDLIST file; - if (FAILED(SHParseDisplayName(nameC, NULL, &file, 0, NULL))) - return name; - TCHAR buffer[MAX_PATH]; - if (!SHGetPathFromIDList(&file, buffer)) + ITEMIDLIST *file; + if (FAILED(SHParseDisplayName(nameC, NULL, reinterpret_cast<LPITEMIDLIST>(&file), 0, NULL))) return name; #else PIDLIST_ABSOLUTE file; if (FAILED(SHParseDisplayName(nameC, NULL, &file, 0, NULL))) return name; +#endif TCHAR buffer[MAX_PATH]; if (!SHGetPathFromIDList(file, buffer)) return name; -#endif QString canonicalName = QString::fromWCharArray(buffer); // Upper case drive letter if (canonicalName.size() > 2 && canonicalName.at(1) == QLatin1Char(':')) diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 5eaea7d9f4..8fae12326f 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -91,7 +91,7 @@ QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QQmlCompile init(parentContext); sharedState = new QQmlObjectCreatorSharedState; - sharedState.setFlag(); // We own it, so we must delete it + topLevelCreator = true; sharedState->componentAttached = 0; sharedState->allCreatedBindings.allocate(compiledData->totalBindingsCount); sharedState->allParserStatusCallbacks.allocate(compiledData->totalParserStatusCount); @@ -115,6 +115,7 @@ QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QQmlCompile init(parentContext); sharedState = inheritedSharedState; + topLevelCreator = false; } void QQmlObjectCreator::init(QQmlContextData *providedParentContext) @@ -139,9 +140,9 @@ void QQmlObjectCreator::init(QQmlContextData *providedParentContext) QQmlObjectCreator::~QQmlObjectCreator() { - if (sharedState.flag()) { + if (topLevelCreator) { { - QRecursionWatcher<QQmlObjectCreatorSharedState, &QQmlObjectCreatorSharedState::recursionNode> watcher(sharedState.data()); + QQmlObjectCreatorRecursionWatcher watcher(this); } for (int i = 0; i < sharedState->allCreatedBindings.count(); ++i) { QQmlAbstractBinding *b = sharedState->allCreatedBindings.at(i); @@ -153,7 +154,10 @@ QQmlObjectCreator::~QQmlObjectCreator() if (ps) ps->d = 0; } - delete sharedState.data(); + while (sharedState->componentAttached) { + QQmlComponentAttached *a = sharedState->componentAttached; + a->rem(); + } } } @@ -1177,7 +1181,7 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru Q_ASSERT(phase == ObjectsCreated || phase == Finalizing); phase = Finalizing; - QRecursionWatcher<QQmlObjectCreatorSharedState, &QQmlObjectCreatorSharedState::recursionNode> watcher(sharedState.data()); + QQmlObjectCreatorRecursionWatcher watcher(this); ActiveOCRestorer ocRestorer(this, QQmlEnginePrivate::get(engine)); { @@ -1262,6 +1266,11 @@ void QQmlObjectCreator::clear() while (!sharedState->allCreatedObjects.isEmpty()) delete sharedState->allCreatedObjects.pop(); + while (sharedState->componentAttached) { + QQmlComponentAttached *a = sharedState->componentAttached; + a->rem(); + } + phase = Done; } @@ -1334,3 +1343,10 @@ bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QObject * } + + +QQmlObjectCreatorRecursionWatcher::QQmlObjectCreatorRecursionWatcher(QQmlObjectCreator *creator) + : sharedState(creator->sharedState) + , watcher(creator->sharedState.data()) +{ +} diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h index 379a3b2970..ad2d67624f 100644 --- a/src/qml/qml/qqmlobjectcreator_p.h +++ b/src/qml/qml/qqmlobjectcreator_p.h @@ -57,7 +57,7 @@ struct QQmlTypeCompiler; class QQmlInstantiationInterrupt; struct QQmlVmeProfiler; -struct QQmlObjectCreatorSharedState +struct QQmlObjectCreatorSharedState : public QSharedData { QQmlContextData *rootContext; QQmlContextData *creationContext; @@ -128,7 +128,8 @@ private: const QVector<QQmlPropertyCache *> &propertyCaches; const QVector<QByteArray> &vmeMetaObjectData; QHash<int, int> objectIndexToId; - QFlagPointer<QQmlObjectCreatorSharedState> sharedState; + QExplicitlySharedDataPointer<QQmlObjectCreatorSharedState> sharedState; + bool topLevelCreator; void *activeVMEDataForRootContext; QObject *_qobject; @@ -142,6 +143,19 @@ private: QQmlVMEMetaObject *_vmeMetaObject; QQmlListProperty<void> _currentList; QV4::ExecutionContext *_qmlContext; + + friend struct QQmlObjectCreatorRecursionWatcher; +}; + +struct QQmlObjectCreatorRecursionWatcher +{ + QQmlObjectCreatorRecursionWatcher(QQmlObjectCreator *creator); + + bool hasRecursed() const { return watcher.hasRecursed(); } + +private: + QExplicitlySharedDataPointer<QQmlObjectCreatorSharedState> sharedState; + QRecursionWatcher<QQmlObjectCreatorSharedState, &QQmlObjectCreatorSharedState::recursionNode> watcher; }; QT_END_NAMESPACE diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc index 3f9de28c9d..6887fefd98 100644 --- a/src/quick/doc/src/qmltypereference.qdoc +++ b/src/quick/doc/src/qmltypereference.qdoc @@ -42,11 +42,11 @@ by this module, organized according to category and purpose. The types provided by the \l {Qt Quick} module are only available in a QML document if that document imports the \c QtQuick namespace. -The current version of the \c QtQuick module is version 2.2, and thus it may be +The current version of the \c QtQuick module is version 2.3, and thus it may be imported via the following statement: \qml -import QtQuick 2.2 +import QtQuick 2.3 \endqml See the \l {Qt Quick} module documentation for more @@ -321,13 +321,13 @@ set of Particle System types for Qt Quick 2 */ /*! -\qmlmodule QtQuick 2.2 +\qmlmodule QtQuick 2.3 \title Qt Quick QML Types \brief This module provides graphical primitives for use in QML. The \l{Qt Quick} module provides graphical primitive types. They can be used with the following import \code -import QtQuick 2.2 +import QtQuick 2.3 \endcode For a more detailed listing of types in the \c {QtQuick} import, see the \l{Qt Quick QML Types} page. diff --git a/src/quick/items/qquickflickable_p_p.h b/src/quick/items/qquickflickable_p_p.h index 07c434f452..33a642eb69 100644 --- a/src/quick/items/qquickflickable_p_p.h +++ b/src/quick/items/qquickflickable_p_p.h @@ -101,7 +101,7 @@ public: AxisData(QQuickFlickablePrivate *fp, void (QQuickFlickablePrivate::*func)(qreal)) : move(fp, func) , transitionToBounds(0) - , viewSize(-1), lastPos(0), startMargin(0), endMargin(0) + , viewSize(-1), lastPos(0), velocity(0), startMargin(0), endMargin(0) , origin(0) , transitionTo(0) , continuousFlickVelocity(0), velocityTime(), vTime(0) diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 3b20241e08..e7c13d15e4 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -1094,6 +1094,7 @@ QQuickWindow::~QQuickWindow() d->windowManager->windowDestroyed(this); } + QCoreApplication::removePostedEvents(this, QEvent::DeferredDelete); QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); delete d->incubationController; d->incubationController = 0; #ifndef QT_NO_DRAGANDDROP diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 106819e86e..ab94e61976 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -1218,9 +1218,11 @@ QImage QSGThreadedRenderLoop::grab(QQuickWindow *window) QImage result; w->thread->mutex.lock(); + m_lockedForSync = true; qCDebug(QSG_LOG_RENDERLOOP) << "- posting grab event"; w->thread->postEvent(new WMGrabEvent(window, &result)); w->thread->waitCondition.wait(&w->thread->mutex); + m_lockedForSync = false; w->thread->mutex.unlock(); qCDebug(QSG_LOG_RENDERLOOP) << "- grab complete"; |