diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2016-12-16 09:59:54 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-12-16 10:08:31 +0000 |
commit | 170f5a89b59f3489267aaede36d7728f90b2e114 (patch) | |
tree | 3c2cf812ceb7b54c1175074c6eaa91701d393a1e /src/quick3d | |
parent | d4e062abfa98285c581c55f42fec590a3815c95f (diff) |
Only pass static metaobjects around and fix EntityLoader
- Ensure the notification changes only pass in static metaobjects.
- Make the EntityLoader use the AsynchronousIfNested incubation mode to avoid
cases where we could destroy something still being incubated
- Add a manual test to test this cases
This fixes the crashes occurring when using NodeInstantiators and EntityLoaders
as delegates.
Change-Id: I104c60b4be34cfb843a74dd09a8b96fdac44657d
Task-number: QTBUG-57655
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick3d')
-rw-r--r-- | src/quick3d/quick3d/items/quick3dentityloader.cpp | 8 | ||||
-rw-r--r-- | src/quick3d/quick3d/items/quick3dentityloader_p.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/quick3d/quick3d/items/quick3dentityloader.cpp b/src/quick3d/quick3d/items/quick3dentityloader.cpp index 63f4cceac..9f305d977 100644 --- a/src/quick3d/quick3d/items/quick3dentityloader.cpp +++ b/src/quick3d/quick3d/items/quick3dentityloader.cpp @@ -54,7 +54,7 @@ class Quick3DEntityLoaderIncubator : public QQmlIncubator { public: Quick3DEntityLoaderIncubator(Quick3DEntityLoader *loader) - : QQmlIncubator(Asynchronous), + : QQmlIncubator(AsynchronousIfNested), m_loader(loader) { } @@ -100,6 +100,12 @@ Quick3DEntityLoader::Quick3DEntityLoader(QNode *parent) { } +Quick3DEntityLoader::~Quick3DEntityLoader() +{ + Q_D(Quick3DEntityLoader); + d->clear(); +} + /*! \qmlproperty QtQml::QtObject Qt3DCore::EntityLoader::entity \readonly diff --git a/src/quick3d/quick3d/items/quick3dentityloader_p.h b/src/quick3d/quick3d/items/quick3dentityloader_p.h index 928f31ada..5721af115 100644 --- a/src/quick3d/quick3d/items/quick3dentityloader_p.h +++ b/src/quick3d/quick3d/items/quick3dentityloader_p.h @@ -76,6 +76,7 @@ class QT3DQUICKSHARED_PRIVATE_EXPORT Quick3DEntityLoader : public QEntity Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) public: explicit Quick3DEntityLoader(QNode *parent = 0); + ~Quick3DEntityLoader(); QObject *entity() const; |