diff options
-rw-r--r-- | src/quicktemplates2/qquickstackview_p.cpp | 8 | ||||
-rw-r--r-- | src/quicktemplates2/qquickstackview_p_p.h | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/quicktemplates2/qquickstackview_p.cpp b/src/quicktemplates2/qquickstackview_p.cpp index 5a83f5e5..96f70d80 100644 --- a/src/quicktemplates2/qquickstackview_p.cpp +++ b/src/quicktemplates2/qquickstackview_p.cpp @@ -72,7 +72,7 @@ private: QQuickStackElement::QQuickStackElement() : QQuickItemViewTransitionableItem(nullptr), index(-1), init(false), removal(false), ownItem(false), ownComponent(false), widthValid(false), heightValid(false), - context(nullptr), component(nullptr), incubator(nullptr), view(nullptr), + context(nullptr), component(nullptr), view(nullptr), status(QQuickStackView::Inactive) { } @@ -107,7 +107,6 @@ QQuickStackElement::~QQuickStackElement() } delete context; - delete incubator; } QQuickStackElement *QQuickStackElement::fromString(const QString &str, QQuickStackView *view) @@ -144,9 +143,8 @@ bool QQuickStackElement::load(QQuickStackView *parent) context = new QQmlContext(creationContext); context->setContextObject(parent); - delete incubator; - incubator = new QQuickStackIncubator(this); - component->create(*incubator, context); + QQuickStackIncubator incubator(this); + component->create(incubator, context); if (component->isError()) qWarning() << qPrintable(component->errorString().trimmed()); } else { diff --git a/src/quicktemplates2/qquickstackview_p_p.h b/src/quicktemplates2/qquickstackview_p_p.h index 679cee09..e57353f3 100644 --- a/src/quicktemplates2/qquickstackview_p_p.h +++ b/src/quicktemplates2/qquickstackview_p_p.h @@ -58,7 +58,6 @@ QT_BEGIN_NAMESPACE class QQmlContext; class QQmlComponent; -class QQmlIncubator; class QQuickStackElement : public QQuickItemViewTransitionableItem, public QQuickItemChangeListener { @@ -93,7 +92,6 @@ public: bool heightValid; QQmlContext *context; QQmlComponent *component; - QQmlIncubator *incubator; QQuickStackView *view; QPointer<QQuickItem> originalParent; QQuickStackView::Status status; |