summaryrefslogtreecommitdiffstats
path: root/src/render/frontend
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2015-06-09 15:26:58 +0200
committerSean Harmer <sean.harmer@kdab.com>2015-06-11 19:27:56 +0000
commit3fc58a37f50cbae3d3e551dc6311771b561175cd (patch)
treef85094e6b55b450f2a2656427f07cf82f7b7d6a9 /src/render/frontend
parent1d2818870034eacb1b0b6de3df279284d3ad24c3 (diff)
QNode parent changes
- introduce QNode::setParent(QNode *) - QNode created with explicit parent now invoke QNodePrivate::_q_addChild - QNode::cleanup introduces, need to be added to the dtor of every QT3D_CLONABLE QNode subclass. Handles proper destruction. - QNode::cleanup added to all classes that should have it. - Updated unit tests of Nodes, Entity, Scene Change-Id: Id2c2784122a78edaae5580fe5976d88be5a1921c Task-number: QTBUG-45947 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend')
-rw-r--r--src/render/frontend/framegraph-components/qcameraselector.cpp5
-rw-r--r--src/render/frontend/framegraph-components/qcameraselector.h1
-rw-r--r--src/render/frontend/framegraph-components/qclearbuffer.cpp5
-rw-r--r--src/render/frontend/framegraph-components/qclearbuffer.h1
-rw-r--r--src/render/frontend/framegraph-components/qframegraph.cpp5
-rw-r--r--src/render/frontend/framegraph-components/qframegraph.h3
-rw-r--r--src/render/frontend/framegraph-components/qframegraphnode.cpp5
-rw-r--r--src/render/frontend/framegraph-components/qframegraphnode.h1
-rw-r--r--src/render/frontend/framegraph-components/qframegraphselector.cpp1
-rw-r--r--src/render/frontend/framegraph-components/qlayerfilter.cpp5
-rw-r--r--src/render/frontend/framegraph-components/qlayerfilter.h1
-rw-r--r--src/render/frontend/framegraph-components/qnodraw.cpp1
-rw-r--r--src/render/frontend/framegraph-components/qrenderpassfilter.cpp5
-rw-r--r--src/render/frontend/framegraph-components/qrenderpassfilter.h1
-rw-r--r--src/render/frontend/framegraph-components/qrendertargetselector.cpp5
-rw-r--r--src/render/frontend/framegraph-components/qrendertargetselector.h1
-rw-r--r--src/render/frontend/framegraph-components/qsortcriterion.cpp5
-rw-r--r--src/render/frontend/framegraph-components/qsortcriterion.h1
-rw-r--r--src/render/frontend/framegraph-components/qsortmethod.cpp5
-rw-r--r--src/render/frontend/framegraph-components/qsortmethod.h1
-rw-r--r--src/render/frontend/framegraph-components/qstateset.cpp1
-rw-r--r--src/render/frontend/framegraph-components/qtechniquefilter.cpp5
-rw-r--r--src/render/frontend/framegraph-components/qtechniquefilter.h1
-rw-r--r--src/render/frontend/framegraph-components/qviewport.cpp5
-rw-r--r--src/render/frontend/framegraph-components/qviewport.h1
-rw-r--r--src/render/frontend/qabstractmesh.cpp5
-rw-r--r--src/render/frontend/qabstractmesh.h3
-rw-r--r--src/render/frontend/qabstractsceneloader.cpp5
-rw-r--r--src/render/frontend/qabstractsceneloader.h1
-rw-r--r--src/render/frontend/qabstracttextureimage.cpp1
-rw-r--r--src/render/frontend/qabstracttextureprovider.cpp3
-rw-r--r--src/render/frontend/qabstracttextureprovider.h1
-rw-r--r--src/render/frontend/qalphacoverage.cpp5
-rw-r--r--src/render/frontend/qalphacoverage.h1
-rw-r--r--src/render/frontend/qalphatest.cpp5
-rw-r--r--src/render/frontend/qalphatest.h1
-rw-r--r--src/render/frontend/qannotation.cpp5
-rw-r--r--src/render/frontend/qannotation.h1
-rw-r--r--src/render/frontend/qblendequation.cpp5
-rw-r--r--src/render/frontend/qblendequation.h1
-rw-r--r--src/render/frontend/qblendstate.cpp5
-rw-r--r--src/render/frontend/qblendstate.h1
-rw-r--r--src/render/frontend/qcolormask.cpp1
-rw-r--r--src/render/frontend/qcuboidmesh.cpp5
-rw-r--r--src/render/frontend/qcuboidmesh.h3
-rw-r--r--src/render/frontend/qcullface.cpp5
-rw-r--r--src/render/frontend/qcullface.h1
-rw-r--r--src/render/frontend/qcylindermesh.cpp4
-rw-r--r--src/render/frontend/qcylindermesh.h3
-rw-r--r--src/render/frontend/qdepthmask.cpp5
-rw-r--r--src/render/frontend/qdepthmask.h1
-rw-r--r--src/render/frontend/qdepthtest.cpp5
-rw-r--r--src/render/frontend/qdepthtest.h1
-rw-r--r--src/render/frontend/qdithering.cpp5
-rw-r--r--src/render/frontend/qdithering.h1
-rw-r--r--src/render/frontend/qeffect.cpp5
-rw-r--r--src/render/frontend/qeffect.h1
-rw-r--r--src/render/frontend/qfrontface.cpp5
-rw-r--r--src/render/frontend/qfrontface.h1
-rw-r--r--src/render/frontend/qlayer.cpp5
-rw-r--r--src/render/frontend/qlayer.h1
-rw-r--r--src/render/frontend/qmaterial.cpp5
-rw-r--r--src/render/frontend/qmaterial.h1
-rw-r--r--src/render/frontend/qmesh.cpp5
-rw-r--r--src/render/frontend/qmesh.h1
-rw-r--r--src/render/frontend/qparameter.cpp5
-rw-r--r--src/render/frontend/qparameter.h1
-rw-r--r--src/render/frontend/qparametermapping.cpp5
-rw-r--r--src/render/frontend/qparametermapping.h1
-rw-r--r--src/render/frontend/qplanemesh.cpp5
-rw-r--r--src/render/frontend/qplanemesh.h3
-rw-r--r--src/render/frontend/qpolygonoffset.cpp5
-rw-r--r--src/render/frontend/qpolygonoffset.h1
-rw-r--r--src/render/frontend/qrenderattachment.cpp5
-rw-r--r--src/render/frontend/qrenderattachment.h1
-rw-r--r--src/render/frontend/qrenderpass.cpp5
-rw-r--r--src/render/frontend/qrenderpass.h1
-rw-r--r--src/render/frontend/qrenderstate.cpp5
-rw-r--r--src/render/frontend/qrenderstate.h4
-rw-r--r--src/render/frontend/qrendertarget.cpp5
-rw-r--r--src/render/frontend/qrendertarget.h1
-rw-r--r--src/render/frontend/qsceneloader.cpp5
-rw-r--r--src/render/frontend/qsceneloader.h1
-rw-r--r--src/render/frontend/qscissortest.cpp5
-rw-r--r--src/render/frontend/qscissortest.h1
-rw-r--r--src/render/frontend/qshaderdata.cpp5
-rw-r--r--src/render/frontend/qshaderdata.h1
-rw-r--r--src/render/frontend/qshaderprogram.cpp5
-rw-r--r--src/render/frontend/qshaderprogram.h1
-rw-r--r--src/render/frontend/qspheremesh.cpp5
-rw-r--r--src/render/frontend/qspheremesh.h3
-rw-r--r--src/render/frontend/qstenciltest.cpp5
-rw-r--r--src/render/frontend/qstenciltest.h1
-rw-r--r--src/render/frontend/qtechnique.cpp5
-rw-r--r--src/render/frontend/qtechnique.h1
-rw-r--r--src/render/frontend/qtextureimage.cpp1
-rw-r--r--src/render/frontend/qtextureproviders.cpp23
-rw-r--r--src/render/frontend/qtorusmesh.cpp6
-rw-r--r--src/render/frontend/qtorusmesh.h3
-rw-r--r--src/render/frontend/qwrapmode.h2
100 files changed, 301 insertions, 21 deletions
diff --git a/src/render/frontend/framegraph-components/qcameraselector.cpp b/src/render/frontend/framegraph-components/qcameraselector.cpp
index b4dc83727..5085adf45 100644
--- a/src/render/frontend/framegraph-components/qcameraselector.cpp
+++ b/src/render/frontend/framegraph-components/qcameraselector.cpp
@@ -76,6 +76,11 @@ QCameraSelector::QCameraSelector(Qt3D::QNode *parent)
: QFrameGraphNode(*new QCameraSelectorPrivate, parent)
{}
+QCameraSelector::~QCameraSelector()
+{
+ QNode::cleanup();
+}
+
void QCameraSelector::setCamera(QEntity *camera)
{
Q_D(QCameraSelector);
diff --git a/src/render/frontend/framegraph-components/qcameraselector.h b/src/render/frontend/framegraph-components/qcameraselector.h
index 023f5f13a..4811d7a96 100644
--- a/src/render/frontend/framegraph-components/qcameraselector.h
+++ b/src/render/frontend/framegraph-components/qcameraselector.h
@@ -54,6 +54,7 @@ class QT3DRENDERERSHARED_EXPORT QCameraSelector : public QFrameGraphNode
public:
explicit QCameraSelector(QNode *parent = 0);
+ ~QCameraSelector();
void setCamera(QEntity *camera);
QEntity *camera() const;
diff --git a/src/render/frontend/framegraph-components/qclearbuffer.cpp b/src/render/frontend/framegraph-components/qclearbuffer.cpp
index e6fc20a84..f40a80883 100644
--- a/src/render/frontend/framegraph-components/qclearbuffer.cpp
+++ b/src/render/frontend/framegraph-components/qclearbuffer.cpp
@@ -64,6 +64,11 @@ QClearBuffer::QClearBuffer(QNode *parent)
{
}
+QClearBuffer::~QClearBuffer()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QClearBuffer::QClearBuffer(QClearBufferPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
diff --git a/src/render/frontend/framegraph-components/qclearbuffer.h b/src/render/frontend/framegraph-components/qclearbuffer.h
index 1559511d3..782ec6ef4 100644
--- a/src/render/frontend/framegraph-components/qclearbuffer.h
+++ b/src/render/frontend/framegraph-components/qclearbuffer.h
@@ -51,6 +51,7 @@ class QT3DRENDERERSHARED_EXPORT QClearBuffer : public QFrameGraphNode
Q_PROPERTY(BufferType buffers READ buffers WRITE setBuffers NOTIFY buffersChanged)
public:
explicit QClearBuffer(QNode *parent = 0);
+ ~QClearBuffer();
enum BufferType {
None = 0,
diff --git a/src/render/frontend/framegraph-components/qframegraph.cpp b/src/render/frontend/framegraph-components/qframegraph.cpp
index 754e90ed3..629128180 100644
--- a/src/render/frontend/framegraph-components/qframegraph.cpp
+++ b/src/render/frontend/framegraph-components/qframegraph.cpp
@@ -98,6 +98,11 @@ QFrameGraph::QFrameGraph(QNode *parent)
{
}
+QFrameGraph::~QFrameGraph()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QFrameGraph::QFrameGraph(QFrameGraphPrivate &dd, QNode *parent)
: QComponent(dd, parent)
diff --git a/src/render/frontend/framegraph-components/qframegraph.h b/src/render/frontend/framegraph-components/qframegraph.h
index c8a88996b..9dc3fbc76 100644
--- a/src/render/frontend/framegraph-components/qframegraph.h
+++ b/src/render/frontend/framegraph-components/qframegraph.h
@@ -47,7 +47,7 @@ namespace Qt3D {
class QFrameGraphPrivate;
class QFrameGraphNode;
-class QT3DRENDERERSHARED_EXPORT QFrameGraph : public Qt3D::QComponent
+class QT3DRENDERERSHARED_EXPORT QFrameGraph : public QComponent
{
Q_OBJECT
// Note : The full namespace has to be used to define the property
@@ -57,6 +57,7 @@ class QT3DRENDERERSHARED_EXPORT QFrameGraph : public Qt3D::QComponent
public:
explicit QFrameGraph(QNode *parent = 0);
+ ~QFrameGraph();
QFrameGraphNode *activeFrameGraph() const;
void setActiveFrameGraph(QFrameGraphNode *activeFrameGraph);
diff --git a/src/render/frontend/framegraph-components/qframegraphnode.cpp b/src/render/frontend/framegraph-components/qframegraphnode.cpp
index 2f81b786e..ad5a8dbd5 100644
--- a/src/render/frontend/framegraph-components/qframegraphnode.cpp
+++ b/src/render/frontend/framegraph-components/qframegraphnode.cpp
@@ -80,6 +80,11 @@ QFrameGraphNode::QFrameGraphNode(QNode *parent)
{
}
+QFrameGraphNode::~QFrameGraphNode()
+{
+ Q_ASSERT_X(QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3D::QFrameGraphNode subclass didn't call QNode::cleanup in its destructor");
+}
+
/*!
Returns a pointer to the parent.
*/
diff --git a/src/render/frontend/framegraph-components/qframegraphnode.h b/src/render/frontend/framegraph-components/qframegraphnode.h
index 7fb5e4dfa..b13fd6eb6 100644
--- a/src/render/frontend/framegraph-components/qframegraphnode.h
+++ b/src/render/frontend/framegraph-components/qframegraphnode.h
@@ -53,6 +53,7 @@ class QT3DRENDERERSHARED_EXPORT QFrameGraphNode : public QNode
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
public:
explicit QFrameGraphNode(QNode *parent = 0);
+ ~QFrameGraphNode();
QFrameGraphNode *parentFrameGraphNode() const;
diff --git a/src/render/frontend/framegraph-components/qframegraphselector.cpp b/src/render/frontend/framegraph-components/qframegraphselector.cpp
index 20fba808c..6b912f974 100644
--- a/src/render/frontend/framegraph-components/qframegraphselector.cpp
+++ b/src/render/frontend/framegraph-components/qframegraphselector.cpp
@@ -71,6 +71,7 @@ QFrameGraphSelector::QFrameGraphSelector(QNode *parent)
QFrameGraphSelector::~QFrameGraphSelector()
{
+ QNode::cleanup();
}
/*!
diff --git a/src/render/frontend/framegraph-components/qlayerfilter.cpp b/src/render/frontend/framegraph-components/qlayerfilter.cpp
index cfccfb987..8df0d6416 100644
--- a/src/render/frontend/framegraph-components/qlayerfilter.cpp
+++ b/src/render/frontend/framegraph-components/qlayerfilter.cpp
@@ -86,6 +86,11 @@ QLayerFilter::QLayerFilter(QNode *parent)
{
}
+QLayerFilter::~QLayerFilter()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QLayerFilter::QLayerFilter(QLayerFilterPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
diff --git a/src/render/frontend/framegraph-components/qlayerfilter.h b/src/render/frontend/framegraph-components/qlayerfilter.h
index 817e01bd6..83b97b1e0 100644
--- a/src/render/frontend/framegraph-components/qlayerfilter.h
+++ b/src/render/frontend/framegraph-components/qlayerfilter.h
@@ -52,6 +52,7 @@ class QT3DRENDERERSHARED_EXPORT QLayerFilter : public QFrameGraphNode
Q_PROPERTY(QStringList layers READ layers WRITE setLayers NOTIFY layersChanged)
public:
explicit QLayerFilter(QNode *parent = 0);
+ ~QLayerFilter();
void setLayers(const QStringList &layers);
QStringList layers() const;
diff --git a/src/render/frontend/framegraph-components/qnodraw.cpp b/src/render/frontend/framegraph-components/qnodraw.cpp
index 0c11f5b34..ed695145d 100644
--- a/src/render/frontend/framegraph-components/qnodraw.cpp
+++ b/src/render/frontend/framegraph-components/qnodraw.cpp
@@ -62,6 +62,7 @@ QNoDraw::QNoDraw(QNode *parent)
QNoDraw::~QNoDraw()
{
+ QNode::cleanup();
}
} // Qt3D
diff --git a/src/render/frontend/framegraph-components/qrenderpassfilter.cpp b/src/render/frontend/framegraph-components/qrenderpassfilter.cpp
index 85fddc7b6..a0c845b00 100644
--- a/src/render/frontend/framegraph-components/qrenderpassfilter.cpp
+++ b/src/render/frontend/framegraph-components/qrenderpassfilter.cpp
@@ -54,6 +54,11 @@ QRenderPassFilter::QRenderPassFilter(QNode *parent)
: QFrameGraphNode(*new QRenderPassFilterPrivate, parent)
{}
+QRenderPassFilter::~QRenderPassFilter()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QRenderPassFilter::QRenderPassFilter(QRenderPassFilterPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
diff --git a/src/render/frontend/framegraph-components/qrenderpassfilter.h b/src/render/frontend/framegraph-components/qrenderpassfilter.h
index 27848d19f..e0f71a78b 100644
--- a/src/render/frontend/framegraph-components/qrenderpassfilter.h
+++ b/src/render/frontend/framegraph-components/qrenderpassfilter.h
@@ -56,6 +56,7 @@ class QT3DRENDERERSHARED_EXPORT QRenderPassFilter : public QFrameGraphNode
public:
explicit QRenderPassFilter(QNode *parent = 0);
+ ~QRenderPassFilter();
QList<QAnnotation *> includes() const;
void addInclude(QAnnotation *criterion);
diff --git a/src/render/frontend/framegraph-components/qrendertargetselector.cpp b/src/render/frontend/framegraph-components/qrendertargetselector.cpp
index fd5a58640..069252766 100644
--- a/src/render/frontend/framegraph-components/qrendertargetselector.cpp
+++ b/src/render/frontend/framegraph-components/qrendertargetselector.cpp
@@ -69,6 +69,11 @@ QRenderTargetSelector::QRenderTargetSelector(QNode *parent)
{
}
+QRenderTargetSelector::~QRenderTargetSelector()
+{
+ QNode::cleanup();
+}
+
void QRenderTargetSelector::setTarget(QRenderTarget *target)
{
Q_D(QRenderTargetSelector);
diff --git a/src/render/frontend/framegraph-components/qrendertargetselector.h b/src/render/frontend/framegraph-components/qrendertargetselector.h
index f98f05f8f..33529d4d9 100644
--- a/src/render/frontend/framegraph-components/qrendertargetselector.h
+++ b/src/render/frontend/framegraph-components/qrendertargetselector.h
@@ -55,6 +55,7 @@ class QT3DRENDERERSHARED_EXPORT QRenderTargetSelector : public QFrameGraphNode
Q_PROPERTY(Qt3D::QRenderTarget *target READ target WRITE setTarget NOTIFY targetChanged)
public:
explicit QRenderTargetSelector(QNode *parent = 0);
+ ~QRenderTargetSelector();
void setTarget(QRenderTarget *target);
QRenderTarget *target() const;
diff --git a/src/render/frontend/framegraph-components/qsortcriterion.cpp b/src/render/frontend/framegraph-components/qsortcriterion.cpp
index 85b5cd9fa..a85608df9 100644
--- a/src/render/frontend/framegraph-components/qsortcriterion.cpp
+++ b/src/render/frontend/framegraph-components/qsortcriterion.cpp
@@ -64,6 +64,11 @@ QSortCriterion::QSortCriterion(QNode *parent)
{
}
+QSortCriterion::~QSortCriterion()
+{
+ QNode::cleanup();
+}
+
QSortCriterion::SortType QSortCriterion::sort() const
{
Q_D(const QSortCriterion);
diff --git a/src/render/frontend/framegraph-components/qsortcriterion.h b/src/render/frontend/framegraph-components/qsortcriterion.h
index ef413eeb5..b3b7848a4 100644
--- a/src/render/frontend/framegraph-components/qsortcriterion.h
+++ b/src/render/frontend/framegraph-components/qsortcriterion.h
@@ -52,6 +52,7 @@ class QT3DRENDERERSHARED_EXPORT QSortCriterion : public QNode
Q_PROPERTY(Qt3D::QSortCriterion::SortType sort READ sort WRITE setSort NOTIFY sortChanged)
public:
explicit QSortCriterion(QNode *parent = 0);
+ ~QSortCriterion();
enum SortType {
StateChangeCost = (1 << 0),
diff --git a/src/render/frontend/framegraph-components/qsortmethod.cpp b/src/render/frontend/framegraph-components/qsortmethod.cpp
index 4f70dd7cd..824c8d198 100644
--- a/src/render/frontend/framegraph-components/qsortmethod.cpp
+++ b/src/render/frontend/framegraph-components/qsortmethod.cpp
@@ -66,6 +66,11 @@ QSortMethod::QSortMethod(QNode *parent)
{
}
+QSortMethod::~QSortMethod()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QSortMethod::QSortMethod(QSortMethodPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
diff --git a/src/render/frontend/framegraph-components/qsortmethod.h b/src/render/frontend/framegraph-components/qsortmethod.h
index 5cb37c9dc..c0f17fdd4 100644
--- a/src/render/frontend/framegraph-components/qsortmethod.h
+++ b/src/render/frontend/framegraph-components/qsortmethod.h
@@ -52,6 +52,7 @@ class QT3DRENDERERSHARED_EXPORT QSortMethod : public QFrameGraphNode
public:
explicit QSortMethod(QNode *parent = 0);
+ ~QSortMethod();
void addCriterion(QSortCriterion *criterion);
void removeCriterion(QSortCriterion *criterion);
diff --git a/src/render/frontend/framegraph-components/qstateset.cpp b/src/render/frontend/framegraph-components/qstateset.cpp
index 6f5149b87..602876d5d 100644
--- a/src/render/frontend/framegraph-components/qstateset.cpp
+++ b/src/render/frontend/framegraph-components/qstateset.cpp
@@ -79,6 +79,7 @@ QStateSet::QStateSet(QStateSetPrivate &dd, QNode *parent)
QStateSet::~QStateSet()
{
+ QNode::cleanup();
}
void QStateSet::copy(const QNode *ref)
diff --git a/src/render/frontend/framegraph-components/qtechniquefilter.cpp b/src/render/frontend/framegraph-components/qtechniquefilter.cpp
index 7d93b40be..1a1efc553 100644
--- a/src/render/frontend/framegraph-components/qtechniquefilter.cpp
+++ b/src/render/frontend/framegraph-components/qtechniquefilter.cpp
@@ -68,6 +68,11 @@ QTechniqueFilter::QTechniqueFilter(QNode *parent)
{
}
+QTechniqueFilter::~QTechniqueFilter()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QTechniqueFilter::QTechniqueFilter(QTechniqueFilterPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
diff --git a/src/render/frontend/framegraph-components/qtechniquefilter.h b/src/render/frontend/framegraph-components/qtechniquefilter.h
index b7ddcb9b4..eae99d231 100644
--- a/src/render/frontend/framegraph-components/qtechniquefilter.h
+++ b/src/render/frontend/framegraph-components/qtechniquefilter.h
@@ -53,6 +53,7 @@ class QT3DRENDERERSHARED_EXPORT QTechniqueFilter : public QFrameGraphNode
Q_OBJECT
public:
explicit QTechniqueFilter(QNode *parent = 0);
+ ~QTechniqueFilter();
QList<QAnnotation *> criteria() const;
void addRequirement(QAnnotation *criterion);
diff --git a/src/render/frontend/framegraph-components/qviewport.cpp b/src/render/frontend/framegraph-components/qviewport.cpp
index 49ae81231..6197dcd52 100644
--- a/src/render/frontend/framegraph-components/qviewport.cpp
+++ b/src/render/frontend/framegraph-components/qviewport.cpp
@@ -65,6 +65,11 @@ QViewport::QViewport(QNode *parent)
{
}
+QViewport::~QViewport()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QViewport::QViewport(QViewportPrivate &dd, QNode *parent)
: QFrameGraphNode(dd, parent)
diff --git a/src/render/frontend/framegraph-components/qviewport.h b/src/render/frontend/framegraph-components/qviewport.h
index 73e3c5f1a..7390e85ae 100644
--- a/src/render/frontend/framegraph-components/qviewport.h
+++ b/src/render/frontend/framegraph-components/qviewport.h
@@ -55,6 +55,7 @@ class QT3DRENDERERSHARED_EXPORT QViewport : public QFrameGraphNode
public:
explicit QViewport(QNode *parent = 0);
+ ~QViewport();
QRectF rect() const;
void setRect(const QRectF& rect);
diff --git a/src/render/frontend/qabstractmesh.cpp b/src/render/frontend/qabstractmesh.cpp
index a4d6a163e..c81f5aa8f 100644
--- a/src/render/frontend/qabstractmesh.cpp
+++ b/src/render/frontend/qabstractmesh.cpp
@@ -76,6 +76,11 @@ QAbstractMesh::QAbstractMesh(QNode *parent)
{
}
+QAbstractMesh::~QAbstractMesh()
+{
+ Q_ASSERT_X(QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3D::QAbstractMesh subclass didn't call QNode::cleanup in its destructor");
+}
+
/*! \internal */
QAbstractMesh::QAbstractMesh(QAbstractMeshPrivate &dd, QNode *parent)
: QComponent(dd, parent)
diff --git a/src/render/frontend/qabstractmesh.h b/src/render/frontend/qabstractmesh.h
index 1be436846..f90e05dff 100644
--- a/src/render/frontend/qabstractmesh.h
+++ b/src/render/frontend/qabstractmesh.h
@@ -65,7 +65,8 @@ class QT3DRENDERERSHARED_EXPORT QAbstractMesh : public QComponent
Q_OBJECT
public:
- QAbstractMesh(QNode *parent = 0);
+ explicit QAbstractMesh(QNode *parent = 0);
+ ~QAbstractMesh();
void update();
diff --git a/src/render/frontend/qabstractsceneloader.cpp b/src/render/frontend/qabstractsceneloader.cpp
index f919a489e..4108b81e5 100644
--- a/src/render/frontend/qabstractsceneloader.cpp
+++ b/src/render/frontend/qabstractsceneloader.cpp
@@ -69,6 +69,11 @@ QAbstractSceneLoader::QAbstractSceneLoader(QNode *parent)
{
}
+QAbstractSceneLoader::~QAbstractSceneLoader()
+{
+ Q_ASSERT_X(QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3D::QAbstractSceneLoader subclass didn't call QNode::cleanup in its destructor");
+}
+
void QAbstractSceneLoader::copy(const QNode *ref)
{
const QAbstractSceneLoader *s = static_cast<const QAbstractSceneLoader*>(ref);
diff --git a/src/render/frontend/qabstractsceneloader.h b/src/render/frontend/qabstractsceneloader.h
index 14aa02e2a..368eb4bc6 100644
--- a/src/render/frontend/qabstractsceneloader.h
+++ b/src/render/frontend/qabstractsceneloader.h
@@ -57,6 +57,7 @@ class QT3DRENDERERSHARED_EXPORT QAbstractSceneLoader : public QComponent
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
public:
explicit QAbstractSceneLoader(QNode *parent = 0);
+ ~QAbstractSceneLoader();
enum Status {
Loading = 0,
diff --git a/src/render/frontend/qabstracttextureimage.cpp b/src/render/frontend/qabstracttextureimage.cpp
index 96d679df6..356a64b08 100644
--- a/src/render/frontend/qabstracttextureimage.cpp
+++ b/src/render/frontend/qabstracttextureimage.cpp
@@ -89,6 +89,7 @@ QAbstractTextureImage::QAbstractTextureImage(QNode *parent)
*/
QAbstractTextureImage::~QAbstractTextureImage()
{
+ Q_ASSERT_X(QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3D::QAbstractTextureImage subclass didn't call QNode::cleanup in its destructor");
}
diff --git a/src/render/frontend/qabstracttextureprovider.cpp b/src/render/frontend/qabstracttextureprovider.cpp
index 75ea92f03..8aaa302b2 100644
--- a/src/render/frontend/qabstracttextureprovider.cpp
+++ b/src/render/frontend/qabstracttextureprovider.cpp
@@ -120,6 +120,9 @@ QAbstractTextureProvider::QAbstractTextureProvider(QAbstractTextureProviderPriva
QAbstractTextureProvider::~QAbstractTextureProvider()
{
+ // The subclasses of QAbstractTextureProvider are only there to set the type on a QTextureProvider
+ // QNode::cleanup needs to be handled here and not in the subclasses.
+ QNode::cleanup();
}
/*!
diff --git a/src/render/frontend/qabstracttextureprovider.h b/src/render/frontend/qabstracttextureprovider.h
index 025270cd5..9f3e385e4 100644
--- a/src/render/frontend/qabstracttextureprovider.h
+++ b/src/render/frontend/qabstracttextureprovider.h
@@ -250,7 +250,6 @@ public:
~QAbstractTextureProvider();
-
Target target() const;
void setFormat(TextureFormat format);
diff --git a/src/render/frontend/qalphacoverage.cpp b/src/render/frontend/qalphacoverage.cpp
index c96980d90..2075b2704 100644
--- a/src/render/frontend/qalphacoverage.cpp
+++ b/src/render/frontend/qalphacoverage.cpp
@@ -57,6 +57,11 @@ QAlphaCoverage::QAlphaCoverage(QNode *parent)
{
}
+QAlphaCoverage::~QAlphaCoverage()
+{
+ QNode::cleanup();
+}
+
} // Qt3D
QT_END_NAMESPACE
diff --git a/src/render/frontend/qalphacoverage.h b/src/render/frontend/qalphacoverage.h
index 9f92bd15d..7ac1c7765 100644
--- a/src/render/frontend/qalphacoverage.h
+++ b/src/render/frontend/qalphacoverage.h
@@ -51,6 +51,7 @@ class QT3DRENDERERSHARED_EXPORT QAlphaCoverage : public QRenderState
Q_OBJECT
public:
explicit QAlphaCoverage(QNode *parent = 0);
+ ~QAlphaCoverage();
private:
Q_DECLARE_PRIVATE(QAlphaCoverage)
diff --git a/src/render/frontend/qalphatest.cpp b/src/render/frontend/qalphatest.cpp
index 1b0498392..1fb92db3a 100644
--- a/src/render/frontend/qalphatest.cpp
+++ b/src/render/frontend/qalphatest.cpp
@@ -64,6 +64,11 @@ QAlphaTest::QAlphaTest(QNode *parent)
{
}
+QAlphaTest::~QAlphaTest()
+{
+ QNode::cleanup();
+}
+
void QAlphaTest::copy(const QNode *ref)
{
QRenderState::copy(ref);
diff --git a/src/render/frontend/qalphatest.h b/src/render/frontend/qalphatest.h
index 645677762..4e8e86ca6 100644
--- a/src/render/frontend/qalphatest.h
+++ b/src/render/frontend/qalphatest.h
@@ -66,6 +66,7 @@ public:
Q_ENUM(AlphaFunc)
explicit QAlphaTest(QNode *parent = 0);
+ ~QAlphaTest();
AlphaFunc func() const;
void setFunc(AlphaFunc func);
diff --git a/src/render/frontend/qannotation.cpp b/src/render/frontend/qannotation.cpp
index 0476e1d6a..9cb67f65c 100644
--- a/src/render/frontend/qannotation.cpp
+++ b/src/render/frontend/qannotation.cpp
@@ -88,6 +88,11 @@ QAnnotation::QAnnotation(QNode *parent)
{
}
+QAnnotation::~QAnnotation()
+{
+ QNode::cleanup();
+}
+
void QAnnotation::setValue(const QVariant &value)
{
Q_D(QAnnotation);
diff --git a/src/render/frontend/qannotation.h b/src/render/frontend/qannotation.h
index 639de2e0e..424177161 100644
--- a/src/render/frontend/qannotation.h
+++ b/src/render/frontend/qannotation.h
@@ -54,6 +54,7 @@ class QT3DRENDERERSHARED_EXPORT QAnnotation : public QNode
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
public:
explicit QAnnotation(QNode *parent = 0);
+ ~QAnnotation();
void setValue(const QVariant &value);
void setName(const QString &customType);
diff --git a/src/render/frontend/qblendequation.cpp b/src/render/frontend/qblendequation.cpp
index 9960bb2b8..1631a74dd 100644
--- a/src/render/frontend/qblendequation.cpp
+++ b/src/render/frontend/qblendequation.cpp
@@ -68,6 +68,11 @@ QBlendEquation::QBlendEquation(QNode *parent)
{
}
+QBlendEquation::~QBlendEquation()
+{
+ QNode::cleanup();
+}
+
QBlendEquation::BlendMode QBlendEquation::mode() const
{
Q_D(const QBlendEquation);
diff --git a/src/render/frontend/qblendequation.h b/src/render/frontend/qblendequation.h
index 280df3155..78df85183 100644
--- a/src/render/frontend/qblendequation.h
+++ b/src/render/frontend/qblendequation.h
@@ -63,6 +63,7 @@ public:
Q_ENUM(BlendMode)
explicit QBlendEquation(QNode *parent = 0);
+ ~QBlendEquation();
BlendMode mode() const;
void setMode(BlendMode mode);
diff --git a/src/render/frontend/qblendstate.cpp b/src/render/frontend/qblendstate.cpp
index 642ce03ab..6711a99db 100644
--- a/src/render/frontend/qblendstate.cpp
+++ b/src/render/frontend/qblendstate.cpp
@@ -88,6 +88,11 @@ QBlendState::QBlendState(QNode *parent)
{
}
+QBlendState::~QBlendState()
+{
+ QNode::cleanup();
+}
+
/*! \fn void QBlendState::copy(const QNode *ref)
\internal
Copies \a ref into this object.
diff --git a/src/render/frontend/qblendstate.h b/src/render/frontend/qblendstate.h
index 2217944f3..7f3901f22 100644
--- a/src/render/frontend/qblendstate.h
+++ b/src/render/frontend/qblendstate.h
@@ -81,6 +81,7 @@ public:
Q_ENUM(Blending)
explicit QBlendState(QNode *parent = 0);
+ ~QBlendState();
Blending srcRGB() const;
void setSrcRGB(Blending srcRGB);
diff --git a/src/render/frontend/qcolormask.cpp b/src/render/frontend/qcolormask.cpp
index 923f16b4d..7d7c79481 100644
--- a/src/render/frontend/qcolormask.cpp
+++ b/src/render/frontend/qcolormask.cpp
@@ -83,6 +83,7 @@ QColorMask::QColorMask(QNode *parent)
QColorMask::~QColorMask()
{
+ QNode::cleanup();
}
bool QColorMask::isRed() const
diff --git a/src/render/frontend/qcuboidmesh.cpp b/src/render/frontend/qcuboidmesh.cpp
index 26238f8b6..665eafd7a 100644
--- a/src/render/frontend/qcuboidmesh.cpp
+++ b/src/render/frontend/qcuboidmesh.cpp
@@ -81,6 +81,11 @@ QCuboidMesh::QCuboidMesh(QNode *parent)
update();
}
+QCuboidMesh::~QCuboidMesh()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QCuboidMesh::QCuboidMesh(QCuboidMeshPrivate &dd, QNode *parent)
: QAbstractMesh(dd, parent)
diff --git a/src/render/frontend/qcuboidmesh.h b/src/render/frontend/qcuboidmesh.h
index 46fdad0e0..4568ddf3a 100644
--- a/src/render/frontend/qcuboidmesh.h
+++ b/src/render/frontend/qcuboidmesh.h
@@ -47,7 +47,7 @@ namespace Qt3D {
class QCuboidMeshPrivate;
-class QT3DRENDERERSHARED_EXPORT QCuboidMesh : public Qt3D::QAbstractMesh
+class QT3DRENDERERSHARED_EXPORT QCuboidMesh : public QAbstractMesh
{
Q_OBJECT
@@ -60,6 +60,7 @@ class QT3DRENDERERSHARED_EXPORT QCuboidMesh : public Qt3D::QAbstractMesh
public:
explicit QCuboidMesh(QNode *parent = 0);
+ ~QCuboidMesh();
void setXExtent(float xExtent);
float xExtent() const;
diff --git a/src/render/frontend/qcullface.cpp b/src/render/frontend/qcullface.cpp
index cf2303ee6..4bd885c34 100644
--- a/src/render/frontend/qcullface.cpp
+++ b/src/render/frontend/qcullface.cpp
@@ -62,6 +62,11 @@ QCullFace::QCullFace(QNode *parent)
{
}
+QCullFace::~QCullFace()
+{
+ QNode::cleanup();
+}
+
void QCullFace::copy(const QNode *ref)
{
QRenderState::copy(ref);
diff --git a/src/render/frontend/qcullface.h b/src/render/frontend/qcullface.h
index 3321e0cd0..646df0811 100644
--- a/src/render/frontend/qcullface.h
+++ b/src/render/frontend/qcullface.h
@@ -63,6 +63,7 @@ public:
Q_ENUM(CullingMode)
explicit QCullFace(QNode *parent = 0);
+ ~QCullFace();
CullingMode mode() const;
void setMode(CullingMode mode);
diff --git a/src/render/frontend/qcylindermesh.cpp b/src/render/frontend/qcylindermesh.cpp
index f7fe495c9..c45e68a74 100644
--- a/src/render/frontend/qcylindermesh.cpp
+++ b/src/render/frontend/qcylindermesh.cpp
@@ -99,6 +99,10 @@ QCylinderMesh::QCylinderMesh(QNode *parent)
update();
}
+QCylinderMesh::~QCylinderMesh()
+{
+ QNode::cleanup();
+}
void QCylinderMesh::setRings(int rings)
{
diff --git a/src/render/frontend/qcylindermesh.h b/src/render/frontend/qcylindermesh.h
index e33c835e6..13fc0f864 100644
--- a/src/render/frontend/qcylindermesh.h
+++ b/src/render/frontend/qcylindermesh.h
@@ -47,7 +47,7 @@ namespace Qt3D {
class QCylinderMeshPrivate;
-class QT3DRENDERERSHARED_EXPORT QCylinderMesh : public Qt3D::QAbstractMesh
+class QT3DRENDERERSHARED_EXPORT QCylinderMesh : public QAbstractMesh
{
Q_OBJECT
Q_PROPERTY(int rings READ rings WRITE setRings NOTIFY ringsChanged)
@@ -56,6 +56,7 @@ class QT3DRENDERERSHARED_EXPORT QCylinderMesh : public Qt3D::QAbstractMesh
Q_PROPERTY(float length READ length WRITE setLength NOTIFY lengthChanged)
public:
explicit QCylinderMesh(QNode *parent = 0);
+ ~QCylinderMesh();
void setRings(int rings);
void setSlices(int slices);
diff --git a/src/render/frontend/qdepthmask.cpp b/src/render/frontend/qdepthmask.cpp
index d3cb3d047..df95b08d7 100644
--- a/src/render/frontend/qdepthmask.cpp
+++ b/src/render/frontend/qdepthmask.cpp
@@ -62,6 +62,11 @@ QDepthMask::QDepthMask(QNode *parent)
{
}
+QDepthMask::~QDepthMask()
+{
+ QNode::cleanup();
+}
+
void QDepthMask::copy(const QNode *ref)
{
QRenderState::copy(ref);
diff --git a/src/render/frontend/qdepthmask.h b/src/render/frontend/qdepthmask.h
index af28d6fac..d8f33d651 100644
--- a/src/render/frontend/qdepthmask.h
+++ b/src/render/frontend/qdepthmask.h
@@ -52,6 +52,7 @@ class QT3DRENDERERSHARED_EXPORT QDepthMask : public QRenderState
Q_PROPERTY (bool mask READ mask WRITE setMask NOTIFY maskChanged)
public:
explicit QDepthMask(QNode *parent = 0);
+ ~QDepthMask();
bool mask() const;
void setMask(bool mask);
diff --git a/src/render/frontend/qdepthtest.cpp b/src/render/frontend/qdepthtest.cpp
index 331a5be8d..716544dac 100644
--- a/src/render/frontend/qdepthtest.cpp
+++ b/src/render/frontend/qdepthtest.cpp
@@ -71,6 +71,11 @@ QDepthTest::QDepthTest(QNode *parent)
{
}
+QDepthTest::~QDepthTest()
+{
+ QNode::cleanup();
+}
+
QDepthTest::DepthFunc QDepthTest::func() const
{
Q_D(const QDepthTest);
diff --git a/src/render/frontend/qdepthtest.h b/src/render/frontend/qdepthtest.h
index 07579a4e9..e58dc25e7 100644
--- a/src/render/frontend/qdepthtest.h
+++ b/src/render/frontend/qdepthtest.h
@@ -65,6 +65,7 @@ public:
Q_ENUM(DepthFunc)
explicit QDepthTest(QNode *parent = 0);
+ ~QDepthTest();
DepthFunc func() const;
void setFunc(DepthFunc func);
diff --git a/src/render/frontend/qdithering.cpp b/src/render/frontend/qdithering.cpp
index 6d8bb5fdf..c82272644 100644
--- a/src/render/frontend/qdithering.cpp
+++ b/src/render/frontend/qdithering.cpp
@@ -59,6 +59,11 @@ QDithering::QDithering(QNode *parent)
{
}
+QDithering::~QDithering()
+{
+ QNode::cleanup();
+}
+
} // Qt3D
QT_END_NAMESPACE
diff --git a/src/render/frontend/qdithering.h b/src/render/frontend/qdithering.h
index bd15ee570..5f41dc3d6 100644
--- a/src/render/frontend/qdithering.h
+++ b/src/render/frontend/qdithering.h
@@ -51,6 +51,7 @@ class QT3DRENDERERSHARED_EXPORT QDithering : public QRenderState
Q_OBJECT
public:
explicit QDithering(QNode *parent = 0);
+ ~QDithering();
private:
Q_DECLARE_PRIVATE(QDithering)
diff --git a/src/render/frontend/qeffect.cpp b/src/render/frontend/qeffect.cpp
index 70590ec58..2dc5a5def 100644
--- a/src/render/frontend/qeffect.cpp
+++ b/src/render/frontend/qeffect.cpp
@@ -59,6 +59,11 @@ QEffect::QEffect(QNode *parent)
{
}
+QEffect::~QEffect()
+{
+ QNode::cleanup();
+}
+
void QEffect::copy(const QNode* ref)
{
QNode::copy(ref);
diff --git a/src/render/frontend/qeffect.h b/src/render/frontend/qeffect.h
index ce91357bd..dd653e516 100644
--- a/src/render/frontend/qeffect.h
+++ b/src/render/frontend/qeffect.h
@@ -54,6 +54,7 @@ class QT3DRENDERERSHARED_EXPORT QEffect
Q_OBJECT
public:
explicit QEffect(QNode *parent = 0);
+ ~QEffect();
void addParameter(QParameter *parameter);
void removeParameter(QParameter *parameter);
diff --git a/src/render/frontend/qfrontface.cpp b/src/render/frontend/qfrontface.cpp
index add4f2bab..b56cce619 100644
--- a/src/render/frontend/qfrontface.cpp
+++ b/src/render/frontend/qfrontface.cpp
@@ -62,6 +62,11 @@ QFrontFace::QFrontFace(QNode *parent)
{
}
+QFrontFace::~QFrontFace()
+{
+ QNode::cleanup();
+}
+
void QFrontFace::copy(const QNode *ref)
{
QRenderState::copy(ref);
diff --git a/src/render/frontend/qfrontface.h b/src/render/frontend/qfrontface.h
index b1d6eb904..ad52685c4 100644
--- a/src/render/frontend/qfrontface.h
+++ b/src/render/frontend/qfrontface.h
@@ -60,6 +60,7 @@ public:
Q_ENUM(FaceDir)
explicit QFrontFace(QNode *parent = 0);
+ ~QFrontFace();
FaceDir direction() const;
void setDirection(FaceDir direction);
diff --git a/src/render/frontend/qlayer.cpp b/src/render/frontend/qlayer.cpp
index afef8df3f..979ef4b20 100644
--- a/src/render/frontend/qlayer.cpp
+++ b/src/render/frontend/qlayer.cpp
@@ -86,6 +86,11 @@ QLayer::QLayer(QNode *parent)
{
}
+QLayer::~QLayer()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QLayer::QLayer(QLayerPrivate &dd, QNode *parent)
: QComponent(dd, parent)
diff --git a/src/render/frontend/qlayer.h b/src/render/frontend/qlayer.h
index 1ebf6e8e6..7075eb592 100644
--- a/src/render/frontend/qlayer.h
+++ b/src/render/frontend/qlayer.h
@@ -53,6 +53,7 @@ class QT3DRENDERERSHARED_EXPORT QLayer : public QComponent
Q_PROPERTY(QStringList names READ names WRITE setNames NOTIFY namesChanged)
public:
explicit QLayer(QNode *parent = 0);
+ ~QLayer();
QStringList names() const;
void setNames(const QStringList &names);
diff --git a/src/render/frontend/qmaterial.cpp b/src/render/frontend/qmaterial.cpp
index 54efb6709..d54961de3 100644
--- a/src/render/frontend/qmaterial.cpp
+++ b/src/render/frontend/qmaterial.cpp
@@ -89,6 +89,11 @@ QMaterial::QMaterial(QNode *parent)
{
}
+QMaterial::~QMaterial()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QMaterial::QMaterial(QMaterialPrivate &dd, QNode *parent)
: QComponent(dd, parent)
diff --git a/src/render/frontend/qmaterial.h b/src/render/frontend/qmaterial.h
index 24206569b..c8cc89ab5 100644
--- a/src/render/frontend/qmaterial.h
+++ b/src/render/frontend/qmaterial.h
@@ -59,6 +59,7 @@ class QT3DRENDERERSHARED_EXPORT QMaterial : public QComponent
public:
explicit QMaterial(QNode *parent = 0);
+ ~QMaterial();
void setEffect(QEffect *effect);
QEffect *effect() const;
diff --git a/src/render/frontend/qmesh.cpp b/src/render/frontend/qmesh.cpp
index 660fd26e5..882fdb2a1 100644
--- a/src/render/frontend/qmesh.cpp
+++ b/src/render/frontend/qmesh.cpp
@@ -82,6 +82,11 @@ QMesh::QMesh(QNode *parent)
{
}
+QMesh::~QMesh()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QMesh::QMesh(QMeshPrivate &dd, QNode *parent)
: QAbstractMesh(dd, parent)
diff --git a/src/render/frontend/qmesh.h b/src/render/frontend/qmesh.h
index 770fda9e0..d087945e8 100644
--- a/src/render/frontend/qmesh.h
+++ b/src/render/frontend/qmesh.h
@@ -61,6 +61,7 @@ class QT3DRENDERERSHARED_EXPORT QMesh : public QAbstractMesh
public:
explicit QMesh(QNode *parent = 0);
+ ~QMesh();
void setSource(const QUrl &source);
QUrl source() const;
diff --git a/src/render/frontend/qparameter.cpp b/src/render/frontend/qparameter.cpp
index 92cb0d4d8..95d35d5c2 100644
--- a/src/render/frontend/qparameter.cpp
+++ b/src/render/frontend/qparameter.cpp
@@ -78,6 +78,11 @@ QParameter::QParameter(QNode *parent)
{
}
+QParameter::~QParameter()
+{
+ QNode::cleanup();
+}
+
QParameter::QParameter(const QString &name, const QVariant &value, QNode *parent)
: QNode(*new QParameterPrivate, parent)
{
diff --git a/src/render/frontend/qparameter.h b/src/render/frontend/qparameter.h
index 01268e15b..043b71414 100644
--- a/src/render/frontend/qparameter.h
+++ b/src/render/frontend/qparameter.h
@@ -56,6 +56,7 @@ class QT3DRENDERERSHARED_EXPORT QParameter : public QNode
public:
explicit QParameter(QNode *parent = 0);
+ ~QParameter();
QParameter(const QString& name, const QVariant& value, QNode* parent = 0);
QParameter(const QString &name, QAbstractTextureProvider *texture, QNode *parent = 0);
diff --git a/src/render/frontend/qparametermapping.cpp b/src/render/frontend/qparametermapping.cpp
index e2b266f8d..c09a384a9 100644
--- a/src/render/frontend/qparametermapping.cpp
+++ b/src/render/frontend/qparametermapping.cpp
@@ -115,6 +115,11 @@ QParameterMapping::QParameterMapping(const QString &parameterName, const QString
d->m_bindingType = bindingType;
}
+QParameterMapping::~QParameterMapping()
+{
+ QNode::cleanup();
+}
+
/*!
\property Qt3D::QParameterMapping::parameterName
diff --git a/src/render/frontend/qparametermapping.h b/src/render/frontend/qparametermapping.h
index 024b5796a..25fcfc809 100644
--- a/src/render/frontend/qparametermapping.h
+++ b/src/render/frontend/qparametermapping.h
@@ -64,6 +64,7 @@ public:
explicit QParameterMapping(QNode *parent = 0);
QParameterMapping(const QString &parameterName, const QString &shaderParameterName, QParameterMapping::Binding bindingType, QNode *parent = 0);
+ ~QParameterMapping();
void setParameterName(const QString &name);
void setShaderVariableName(const QString &name);
diff --git a/src/render/frontend/qplanemesh.cpp b/src/render/frontend/qplanemesh.cpp
index 6aca02247..1bb06d79d 100644
--- a/src/render/frontend/qplanemesh.cpp
+++ b/src/render/frontend/qplanemesh.cpp
@@ -66,6 +66,11 @@ QPlaneMesh::QPlaneMesh(QNode *parent)
update();
}
+QPlaneMesh::~QPlaneMesh()
+{
+ QNode::cleanup();
+}
+
void QPlaneMesh::copy(const QNode *ref)
{
QAbstractMesh::copy(ref);
diff --git a/src/render/frontend/qplanemesh.h b/src/render/frontend/qplanemesh.h
index 47a3c79bf..c2346a1de 100644
--- a/src/render/frontend/qplanemesh.h
+++ b/src/render/frontend/qplanemesh.h
@@ -47,7 +47,7 @@ namespace Qt3D {
class QPlaneMeshPrivate;
-class QT3DRENDERERSHARED_EXPORT QPlaneMesh : public Qt3D::QAbstractMesh
+class QT3DRENDERERSHARED_EXPORT QPlaneMesh : public QAbstractMesh
{
Q_OBJECT
@@ -57,6 +57,7 @@ class QT3DRENDERERSHARED_EXPORT QPlaneMesh : public Qt3D::QAbstractMesh
public:
explicit QPlaneMesh(QNode *parent = 0);
+ ~QPlaneMesh();
void setWidth(float width);
float width() const;
diff --git a/src/render/frontend/qpolygonoffset.cpp b/src/render/frontend/qpolygonoffset.cpp
index 192e1ef02..d252d4893 100644
--- a/src/render/frontend/qpolygonoffset.cpp
+++ b/src/render/frontend/qpolygonoffset.cpp
@@ -62,6 +62,11 @@ QPolygonOffset::QPolygonOffset(QNode *parent)
{
}
+QPolygonOffset::~QPolygonOffset()
+{
+ QNode::cleanup();
+}
+
float QPolygonOffset::factor() const
{
Q_D(const QPolygonOffset);
diff --git a/src/render/frontend/qpolygonoffset.h b/src/render/frontend/qpolygonoffset.h
index 446febf4f..339437ae1 100644
--- a/src/render/frontend/qpolygonoffset.h
+++ b/src/render/frontend/qpolygonoffset.h
@@ -53,6 +53,7 @@ class QT3DRENDERERSHARED_EXPORT QPolygonOffset : public QRenderState
Q_PROPERTY(float units READ units WRITE setUnits NOTIFY unitsChanged)
public:
explicit QPolygonOffset(QNode *parent = Q_NULLPTR);
+ ~QPolygonOffset();
float factor() const;
void setFactor(float factor);
diff --git a/src/render/frontend/qrenderattachment.cpp b/src/render/frontend/qrenderattachment.cpp
index 8e3fd30af..35db47cc7 100644
--- a/src/render/frontend/qrenderattachment.cpp
+++ b/src/render/frontend/qrenderattachment.cpp
@@ -69,6 +69,11 @@ QRenderAttachment::QRenderAttachment(QNode *parent)
{
}
+QRenderAttachment::~QRenderAttachment()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QRenderAttachment::QRenderAttachment(QRenderAttachmentPrivate &dd, QNode *parent)
: QNode(dd, parent)
diff --git a/src/render/frontend/qrenderattachment.h b/src/render/frontend/qrenderattachment.h
index 5cdd8113b..15706fb1d 100644
--- a/src/render/frontend/qrenderattachment.h
+++ b/src/render/frontend/qrenderattachment.h
@@ -92,6 +92,7 @@ public:
Q_ENUM(CubeMapFace)
explicit QRenderAttachment(QNode *parent = 0);
+ ~QRenderAttachment();
void setType(RenderAttachmentType type);
RenderAttachmentType type() const;
diff --git a/src/render/frontend/qrenderpass.cpp b/src/render/frontend/qrenderpass.cpp
index b6b16dbd6..f6feba36a 100644
--- a/src/render/frontend/qrenderpass.cpp
+++ b/src/render/frontend/qrenderpass.cpp
@@ -77,6 +77,11 @@ QRenderPass::QRenderPass(QNode *parent)
{
}
+QRenderPass::~QRenderPass()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QRenderPass::QRenderPass(QRenderPassPrivate &dd, QNode *parent)
: QNode(dd, parent)
diff --git a/src/render/frontend/qrenderpass.h b/src/render/frontend/qrenderpass.h
index 1f401860d..d921829ac 100644
--- a/src/render/frontend/qrenderpass.h
+++ b/src/render/frontend/qrenderpass.h
@@ -65,6 +65,7 @@ class QT3DRENDERERSHARED_EXPORT QRenderPass : public QNode
public:
explicit QRenderPass(QNode *parent = 0);
+ ~QRenderPass();
QString glslNameForParameter(QString paramName) const;
diff --git a/src/render/frontend/qrenderstate.cpp b/src/render/frontend/qrenderstate.cpp
index 1b13b5d03..a572b5e06 100644
--- a/src/render/frontend/qrenderstate.cpp
+++ b/src/render/frontend/qrenderstate.cpp
@@ -52,6 +52,11 @@ QRenderStatePrivate::QRenderStatePrivate(QRenderState::Type type)
{
}
+QRenderState::~QRenderState()
+{
+ Q_ASSERT_X(QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3D::QRenderState subclass didn't call QNode::cleanup in its destructor");
+}
+
QRenderState::Type QRenderState::type() const
{
Q_D(const QRenderState);
diff --git a/src/render/frontend/qrenderstate.h b/src/render/frontend/qrenderstate.h
index 7f428b426..90290f8dc 100644
--- a/src/render/frontend/qrenderstate.h
+++ b/src/render/frontend/qrenderstate.h
@@ -70,10 +70,12 @@ public:
};
Q_ENUM(Type)
+ ~QRenderState();
+
Type type() const;
protected:
- QRenderState(QRenderStatePrivate &dd, QNode *parent = 0);
+ QRenderState(QRenderStatePrivate &dd, QNode *parent = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QRenderState)
diff --git a/src/render/frontend/qrendertarget.cpp b/src/render/frontend/qrendertarget.cpp
index 532a803c8..d6297d7de 100644
--- a/src/render/frontend/qrendertarget.cpp
+++ b/src/render/frontend/qrendertarget.cpp
@@ -65,6 +65,11 @@ QRenderTarget::QRenderTarget(QNode *parent)
{
}
+QRenderTarget::~QRenderTarget()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QRenderTarget::QRenderTarget(QRenderTargetPrivate &dd, QNode *parent)
: QComponent(dd, parent)
diff --git a/src/render/frontend/qrendertarget.h b/src/render/frontend/qrendertarget.h
index 169f7c882..8b2860bca 100644
--- a/src/render/frontend/qrendertarget.h
+++ b/src/render/frontend/qrendertarget.h
@@ -52,6 +52,7 @@ class QT3DRENDERERSHARED_EXPORT QRenderTarget : public QComponent
Q_OBJECT
public:
explicit QRenderTarget(QNode *parent = 0);
+ ~QRenderTarget();
void addAttachment(QRenderAttachment *attachment);
void removeAttachment(QRenderAttachment *attachment);
diff --git a/src/render/frontend/qsceneloader.cpp b/src/render/frontend/qsceneloader.cpp
index a5662a694..cc0a25afa 100644
--- a/src/render/frontend/qsceneloader.cpp
+++ b/src/render/frontend/qsceneloader.cpp
@@ -51,6 +51,11 @@ QSceneLoader::QSceneLoader(QNode *parent)
{
}
+QSceneLoader::~QSceneLoader()
+{
+ QNode::cleanup();
+}
+
// Called in main thread
void QSceneLoader::sceneChangeEvent(const QSceneChangePtr &change)
{
diff --git a/src/render/frontend/qsceneloader.h b/src/render/frontend/qsceneloader.h
index 2c3914811..8c0092beb 100644
--- a/src/render/frontend/qsceneloader.h
+++ b/src/render/frontend/qsceneloader.h
@@ -48,6 +48,7 @@ class QT3DRENDERERSHARED_EXPORT QSceneLoader : public Render::QAbstractSceneLoad
Q_OBJECT
public:
explicit QSceneLoader(QNode *parent = 0);
+ ~QSceneLoader();
void sceneChangeEvent(const QSceneChangePtr &change) Q_DECL_OVERRIDE;
protected:
diff --git a/src/render/frontend/qscissortest.cpp b/src/render/frontend/qscissortest.cpp
index 5c8922d5f..79ddd61bd 100644
--- a/src/render/frontend/qscissortest.cpp
+++ b/src/render/frontend/qscissortest.cpp
@@ -69,6 +69,11 @@ QScissorTest::QScissorTest(QNode *parent)
{
}
+QScissorTest::~QScissorTest()
+{
+ QNode::cleanup();
+}
+
void QScissorTest::copy(const QNode *ref)
{
QRenderState::copy(ref);
diff --git a/src/render/frontend/qscissortest.h b/src/render/frontend/qscissortest.h
index 136d06807..aae531cd3 100644
--- a/src/render/frontend/qscissortest.h
+++ b/src/render/frontend/qscissortest.h
@@ -56,6 +56,7 @@ class QT3DRENDERERSHARED_EXPORT QScissorTest : public QRenderState
public:
explicit QScissorTest(QNode *parent = 0);
+ ~QScissorTest();
int left() const;
void setLeft(int left);
diff --git a/src/render/frontend/qshaderdata.cpp b/src/render/frontend/qshaderdata.cpp
index 6caf7e5b1..3ce956750 100644
--- a/src/render/frontend/qshaderdata.cpp
+++ b/src/render/frontend/qshaderdata.cpp
@@ -79,6 +79,11 @@ QShaderData::QShaderData(QNode *parent)
{
}
+QShaderData::~QShaderData()
+{
+ QNode::cleanup();
+}
+
PropertyReaderInterfacePtr QShaderData::propertyReader() const
{
Q_D(const QShaderData);
diff --git a/src/render/frontend/qshaderdata.h b/src/render/frontend/qshaderdata.h
index f526dcfc1..7c595f415 100644
--- a/src/render/frontend/qshaderdata.h
+++ b/src/render/frontend/qshaderdata.h
@@ -60,6 +60,7 @@ class QT3DRENDERERSHARED_EXPORT QShaderData : public QComponent
Q_OBJECT
public:
explicit QShaderData(QNode *parent = 0);
+ ~QShaderData();
enum TransformType {
ModelToEye = 0,
diff --git a/src/render/frontend/qshaderprogram.cpp b/src/render/frontend/qshaderprogram.cpp
index 7eb170b6b..5787825b8 100644
--- a/src/render/frontend/qshaderprogram.cpp
+++ b/src/render/frontend/qshaderprogram.cpp
@@ -73,6 +73,11 @@ QShaderProgram::QShaderProgram(QNode *parent)
{
}
+QShaderProgram::~QShaderProgram()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QShaderProgram::QShaderProgram(QShaderProgramPrivate &dd, QNode *parent)
: QNode(dd, parent)
diff --git a/src/render/frontend/qshaderprogram.h b/src/render/frontend/qshaderprogram.h
index 4023980a8..f2ca7bf74 100644
--- a/src/render/frontend/qshaderprogram.h
+++ b/src/render/frontend/qshaderprogram.h
@@ -58,6 +58,7 @@ class QT3DRENDERERSHARED_EXPORT QShaderProgram : public QNode
public:
explicit QShaderProgram(QNode *parent = 0);
+ ~QShaderProgram();
enum ShaderType {
Vertex = 0,
diff --git a/src/render/frontend/qspheremesh.cpp b/src/render/frontend/qspheremesh.cpp
index 7e103e8fe..0c6fdbaa3 100644
--- a/src/render/frontend/qspheremesh.cpp
+++ b/src/render/frontend/qspheremesh.cpp
@@ -89,6 +89,11 @@ QSphereMesh::QSphereMesh(QNode *parent)
update();
}
+QSphereMesh::~QSphereMesh()
+{
+ QNode::cleanup();
+}
+
void QSphereMesh::copy(const QNode *ref)
{
QAbstractMesh::copy(ref);
diff --git a/src/render/frontend/qspheremesh.h b/src/render/frontend/qspheremesh.h
index 567b1ed49..317a8fe8c 100644
--- a/src/render/frontend/qspheremesh.h
+++ b/src/render/frontend/qspheremesh.h
@@ -46,7 +46,7 @@ namespace Qt3D {
class QSphereMeshPrivate;
-class QT3DRENDERERSHARED_EXPORT QSphereMesh : public Qt3D::QAbstractMesh
+class QT3DRENDERERSHARED_EXPORT QSphereMesh : public QAbstractMesh
{
Q_OBJECT
Q_PROPERTY(int rings READ rings WRITE setRings NOTIFY ringsChanged)
@@ -56,6 +56,7 @@ class QT3DRENDERERSHARED_EXPORT QSphereMesh : public Qt3D::QAbstractMesh
public:
explicit QSphereMesh(QNode *parent = 0);
+ ~QSphereMesh();
void setRings(int rings);
void setSlices(int slices);
diff --git a/src/render/frontend/qstenciltest.cpp b/src/render/frontend/qstenciltest.cpp
index 2ff78625d..66b24dfed 100644
--- a/src/render/frontend/qstenciltest.cpp
+++ b/src/render/frontend/qstenciltest.cpp
@@ -67,6 +67,11 @@ QStencilTest::QStencilTest(QNode *parent)
{
}
+QStencilTest::~QStencilTest()
+{
+ QNode::cleanup();
+}
+
void QStencilTest::copy(const QNode *ref)
{
QRenderState::copy(ref);
diff --git a/src/render/frontend/qstenciltest.h b/src/render/frontend/qstenciltest.h
index fdc61037b..d05675a15 100644
--- a/src/render/frontend/qstenciltest.h
+++ b/src/render/frontend/qstenciltest.h
@@ -76,6 +76,7 @@ public:
Q_ENUM(StencilFunc)
explicit QStencilTest(QNode *parent = 0);
+ ~QStencilTest();
uint mask() const;
void setMask(uint mask);
diff --git a/src/render/frontend/qtechnique.cpp b/src/render/frontend/qtechnique.cpp
index dd72ec458..01699715e 100644
--- a/src/render/frontend/qtechnique.cpp
+++ b/src/render/frontend/qtechnique.cpp
@@ -65,6 +65,11 @@ QTechnique::QTechnique(QNode *parent)
QObject::connect(&d->m_openGLFilter, SIGNAL(openGLFilterChanged()), this, SLOT(_q_openGLFilterChanged()));
}
+QTechnique::~QTechnique()
+{
+ QNode::cleanup();
+}
+
/*! \internal */
QTechnique::QTechnique(QTechniquePrivate &dd, QNode *parent)
: QNode(dd, parent)
diff --git a/src/render/frontend/qtechnique.h b/src/render/frontend/qtechnique.h
index 199a7d57a..fd3225d62 100644
--- a/src/render/frontend/qtechnique.h
+++ b/src/render/frontend/qtechnique.h
@@ -59,6 +59,7 @@ class QT3DRENDERERSHARED_EXPORT QTechnique : public QNode
public:
explicit QTechnique(QNode *parent = 0);
+ ~QTechnique();
void addAnnotation(QAnnotation *criterion);
void removeAnnotation(QAnnotation *criterion);
diff --git a/src/render/frontend/qtextureimage.cpp b/src/render/frontend/qtextureimage.cpp
index e3ada359a..294f36a92 100644
--- a/src/render/frontend/qtextureimage.cpp
+++ b/src/render/frontend/qtextureimage.cpp
@@ -125,6 +125,7 @@ QTextureImage::QTextureImage(QNode *parent)
*/
QTextureImage::~QTextureImage()
{
+ QNode::cleanup();
}
/*!
diff --git a/src/render/frontend/qtextureproviders.cpp b/src/render/frontend/qtextureproviders.cpp
index eabcc2cf7..2852f5c32 100644
--- a/src/render/frontend/qtextureproviders.cpp
+++ b/src/render/frontend/qtextureproviders.cpp
@@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
/*!
- \class QT3D::QTexture1D
+ \class Qt3D::QTexture1D
\since 5.5
\brief A QAbstractTextureProvider with a Target1D target format.
*/
@@ -59,7 +59,7 @@ QTexture1D::~QTexture1D()
}
/*!
- \class QT3D::QTexture1DArray
+ \class Qt3D::QTexture1DArray
\since 5.5
\brief A QAbstractTextureProvider with a Target1DArray target format.
*/
@@ -77,7 +77,7 @@ QTexture1DArray::~QTexture1DArray()
}
/*!
- \class QT3D::QTexture2D
+ \class Qt3D::QTexture2D
\since 5.5
\brief A QAbstractTextureProvider with a Target2D target format.
*/
@@ -95,7 +95,7 @@ QTexture2D::~QTexture2D()
}
/*!
- \class QT3D::QTexture2DArray
+ \class Qt3D::QTexture2DArray
\since 5.5
\brief A QAbstractTextureProvider with a Target2DArray target format.
*/
@@ -114,7 +114,7 @@ QTexture2DArray::~QTexture2DArray()
/*!
- \class QT3D::QTexture3D
+ \class Qt3D::QTexture3D
\since 5.5
\brief A QAbstractTextureProvider with a Target3D target format.
*/
@@ -132,7 +132,7 @@ QTexture3D::~QTexture3D()
}
/*!
- \class QT3D::QTextureCubeMap
+ \class Qt3D::QTextureCubeMap
\since 5.5
\brief A QAbstractTextureProvider with a TargetCubeMap target format.
*/
@@ -150,7 +150,7 @@ QTextureCubeMap::~QTextureCubeMap()
}
/*!
- \class QT3D::QTextureCubeMapArray
+ \class Qt3D::QTextureCubeMapArray
\since 5.5
\brief A QAbstractTextureProvider with a TargetCubeMapArray target format.
*/
@@ -165,10 +165,11 @@ QTextureCubeMapArray::QTextureCubeMapArray(QNode *parent)
QTextureCubeMapArray::~QTextureCubeMapArray()
{
+ QNode::cleanup();
}
/*!
- \class QT3D::QTexture2DMultisample
+ \class Qt3D::QTexture2DMultisample
\since 5.5
\brief A QAbstractTextureProvider with a Target2DMultisample target format.
*/
@@ -186,7 +187,7 @@ QTexture2DMultisample::~QTexture2DMultisample()
}
/*!
- \class QT3D::QTexture2DMultisampleArray
+ \class Qt3D::QTexture2DMultisampleArray
\since 5.5
\brief A QAbstractTextureProvider with a Target2DMultisampleArray target format.
*/
@@ -204,7 +205,7 @@ QTexture2DMultisampleArray::~QTexture2DMultisampleArray()
}
/*!
- \class QT3D::QTextureRectangle
+ \class Qt3D::QTextureRectangle
\since 5.5
\brief A QAbstractTextureProvider with a TargetRectangle target format.
*/
@@ -222,7 +223,7 @@ QTextureRectangle::~QTextureRectangle()
}
/*!
- \class QT3D::QTextureBuffer
+ \class Qt3D::QTextureBuffer
\since 5.5
\brief A QAbstractTextureProvider with a TargetBuffer target format.
*/
diff --git a/src/render/frontend/qtorusmesh.cpp b/src/render/frontend/qtorusmesh.cpp
index 4a975d8d8..d4f3e3ba0 100644
--- a/src/render/frontend/qtorusmesh.cpp
+++ b/src/render/frontend/qtorusmesh.cpp
@@ -98,6 +98,12 @@ QTorusMesh::QTorusMesh(QNode *parent)
{
update();
}
+
+QTorusMesh::~QTorusMesh()
+{
+ QNode::cleanup();
+}
+
void QTorusMesh::setRings(int rings)
{
Q_D(QTorusMesh);
diff --git a/src/render/frontend/qtorusmesh.h b/src/render/frontend/qtorusmesh.h
index 0e0edacd9..a434008b5 100644
--- a/src/render/frontend/qtorusmesh.h
+++ b/src/render/frontend/qtorusmesh.h
@@ -47,7 +47,7 @@ namespace Qt3D {
class QTorusMeshPrivate;
-class QT3DRENDERERSHARED_EXPORT QTorusMesh : public Qt3D::QAbstractMesh
+class QT3DRENDERERSHARED_EXPORT QTorusMesh : public QAbstractMesh
{
Q_OBJECT
Q_PROPERTY(int rings READ rings WRITE setRings NOTIFY ringsChanged)
@@ -56,6 +56,7 @@ class QT3DRENDERERSHARED_EXPORT QTorusMesh : public Qt3D::QAbstractMesh
Q_PROPERTY(float minorRadius READ minorRadius WRITE setMinorRadius NOTIFY minorRadiusChanged)
public:
explicit QTorusMesh(QNode *parent = 0);
+ ~QTorusMesh();
void setRings(int rings);
void setSlices(int slices);
diff --git a/src/render/frontend/qwrapmode.h b/src/render/frontend/qwrapmode.h
index d0333c749..faec41cae 100644
--- a/src/render/frontend/qwrapmode.h
+++ b/src/render/frontend/qwrapmode.h
@@ -46,7 +46,7 @@ namespace Qt3D {
class QTextureWrapModePrivate;
-class QT3DRENDERERSHARED_EXPORT QTextureWrapMode: public QObject
+class QT3DRENDERERSHARED_EXPORT QTextureWrapMode : public QObject
{
Q_OBJECT
Q_PROPERTY(WrapMode x READ x WRITE setX NOTIFY xChanged)