summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-05-10 23:21:21 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-05-10 23:21:21 (GMT)
commit74d43d285f611a332d239c3669b7c90e23741b25 (patch)
treee6735e13fc6aac0524cd1898e7cb01d0bb96081d
parent84c3cdd69b6f7fec4cb30563661fcbd4386f29a2 (diff)
downloadQt-74d43d285f611a332d239c3669b7c90e23741b25.zip
Qt-74d43d285f611a332d239c3669b7c90e23741b25.tar.gz
Qt-74d43d285f611a332d239c3669b7c90e23741b25.tar.bz2
Make sure we correctly remove the PathView attached property object.
If we don't, we get some nasty random crashes.
-rw-r--r--src/declarative/fx/qfxpathview.cpp7
-rw-r--r--src/declarative/fx/qfxpathview.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp
index 77d5fa2..b7215cf 100644
--- a/src/declarative/fx/qfxpathview.cpp
+++ b/src/declarative/fx/qfxpathview.cpp
@@ -66,6 +66,11 @@ public:
{
}
+ ~QFxPathViewAttached()
+ {
+ QFxPathView::attachedProperties.remove(parent());
+ }
+
QVariant value(const QByteArray &name) const
{
return mo->value(name);
@@ -583,7 +588,7 @@ void QFxPathViewPrivate::regenerate()
void QFxPathViewPrivate::updateItem(QFxItem *item, qreal percent)
{
- if (QObject *obj = QFxPathView::attachedProperties.value(item)) {
+ if (QObject *obj = QFxPathView::qmlAttachedProperties(item)) {
foreach(const QString &attr, path->attributes())
static_cast<QFxPathViewAttached *>(obj)->setValue(attr.toLatin1(), path->attributeAt(attr, percent));
}
diff --git a/src/declarative/fx/qfxpathview.h b/src/declarative/fx/qfxpathview.h
index 0e1ac6f..2ecd04e 100644
--- a/src/declarative/fx/qfxpathview.h
+++ b/src/declarative/fx/qfxpathview.h
@@ -122,6 +122,7 @@ protected:
QFxPathView(QFxPathViewPrivate &dd, QFxItem *parent);
private:
+ friend class QFxPathViewAttached;
static QHash<QObject*, QObject*> attachedProperties;
Q_DISABLE_COPY(QFxPathView)
Q_DECLARE_PRIVATE(QFxPathView)