diff options
-rw-r--r-- | src/qml/qml/qqmlcomponent.cpp | 4 | ||||
-rw-r--r-- | src/qml/qml/qqmlcomponent_p.h | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index e9a3449a22..1da2f1c109 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -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; }; |