aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles/qquickimageparticle_p.h
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-10-23 16:01:57 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-10-27 14:35:26 +0100
commit32af8055985c1f978574eec62512638f472e8290 (patch)
tree875dcea67e2d8289c055ce96ebb8c048dff025ee /src/particles/qquickimageparticle_p.h
parentc7ea1cd9237045e3a8b2b148c57f6d26dd547f7e (diff)
Fix leaks in QQuickImageParticle
Make sure that ImageData instances, m_shadowData as well as the QSGGeometry of particle nodes are destroyed together with their QQuickImageParticle. Also implement the assignment operator for QQuickParticleData to avoid its v8Datum pointer to be copied over to the shadow datum in getShadowDatum. This would cause a double delete of the QQuickV4ParticleData when trying to call clearShadows() in the destructor. Task-number: QTBUG-36782 Change-Id: Ie03f2be0415daeb7f4f6e5f92295a3ab26a62155 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/particles/qquickimageparticle_p.h')
-rw-r--r--src/particles/qquickimageparticle_p.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/particles/qquickimageparticle_p.h b/src/particles/qquickimageparticle_p.h
index ac61ceeb10..657d945bca 100644
--- a/src/particles/qquickimageparticle_p.h
+++ b/src/particles/qquickimageparticle_p.h
@@ -352,17 +352,16 @@ private:
QUrl source;
QQuickPixmap pix;
};
- ImageData *m_image;
- ImageData *m_colorTable;
- ImageData *m_sizeTable;
- ImageData *m_opacityTable;
+ QScopedPointer<ImageData> m_image;
+ QScopedPointer<ImageData> m_colorTable;
+ QScopedPointer<ImageData> m_sizeTable;
+ QScopedPointer<ImageData> m_opacityTable;
bool loadingSomething();
QColor m_color;
qreal m_color_variation;
- QSGGeometryNode *m_rootNode;
QHash<int, QSGGeometryNode *> m_nodes;
QHash<int, int> m_idxStarts;//TODO: Proper resizing will lead to needing a spriteEngine per particle - do this after sprite engine gains transparent sharing?
QList<QPair<int, int> > m_startsIdx;//Same data, optimized for alternate retrieval