diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-05-10 23:21:21 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-05-10 23:21:21 (GMT) |
commit | 74d43d285f611a332d239c3669b7c90e23741b25 (patch) | |
tree | e6735e13fc6aac0524cd1898e7cb01d0bb96081d | |
parent | 84c3cdd69b6f7fec4cb30563661fcbd4386f29a2 (diff) | |
download | Qt-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.cpp | 7 | ||||
-rw-r--r-- | src/declarative/fx/qfxpathview.h | 1 |
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) |