aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-10-11 13:09:42 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-18 01:47:23 +0200
commit8ff1f926ea1d18b226060b4ea1bf6924eceba8c6 (patch)
tree702dfbdbd41a94469d778411ad263f73d4f18612 /src
parentbca5c6d21711d5844c435bd41a71f8fe356a1038 (diff)
Don't keep a cache of created QSGDragAttached objects.
It's unnecessary and can potentially return stale objects. Change-Id: Ia04b9a58757ef06d3178e6a64e168f68abc1c9d8 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/items/qsgdrag.cpp12
-rw-r--r--src/declarative/items/qsgdrag_p.h4
-rw-r--r--src/declarative/items/qsgmousearea.cpp2
3 files changed, 1 insertions, 17 deletions
diff --git a/src/declarative/items/qsgdrag.cpp b/src/declarative/items/qsgdrag.cpp
index 7c73db7d38..b95e495477 100644
--- a/src/declarative/items/qsgdrag.cpp
+++ b/src/declarative/items/qsgdrag.cpp
@@ -113,18 +113,6 @@ public:
*/
-QSGDragAttached *QSGDragAttached::properties(QObject *obj)
-{
- QSGDragAttached *rv = attachedProperties.value(obj);
- if (!rv) {
- rv = new QSGDragAttached(obj);
- attachedProperties.insert(obj, rv);
- }
- return rv;
-}
-
-QHash<QObject*, QSGDragAttached *> QSGDragAttached::attachedProperties;
-
void QSGDragAttachedPrivate::itemGeometryChanged(QSGItem *, const QRectF &newGeometry, const QRectF &oldGeometry)
{
Q_Q(QSGDragAttached);
diff --git a/src/declarative/items/qsgdrag_p.h b/src/declarative/items/qsgdrag_p.h
index a1b6cdca9b..246c6e6beb 100644
--- a/src/declarative/items/qsgdrag_p.h
+++ b/src/declarative/items/qsgdrag_p.h
@@ -183,8 +183,6 @@ public:
Q_INVOKABLE int drop();
- static QSGDragAttached *properties(QObject *obj);
-
public Q_SLOTS:
void start(QDeclarativeV8Function *);
void cancel();
@@ -199,8 +197,6 @@ Q_SIGNALS:
void proposedActionChanged();
private:
- static QHash<QObject*, QSGDragAttached *> attachedProperties;
-
Q_DECLARE_PRIVATE(QSGDragAttached)
};
diff --git a/src/declarative/items/qsgmousearea.cpp b/src/declarative/items/qsgmousearea.cpp
index 4d14eaa565..a401b52e95 100644
--- a/src/declarative/items/qsgmousearea.cpp
+++ b/src/declarative/items/qsgmousearea.cpp
@@ -178,7 +178,7 @@ void QSGDrag::setFilterChildren(bool filter)
QSGDragAttached *QSGDrag::qmlAttachedProperties(QObject *obj)
{
- return QSGDragAttached::properties(obj);
+ return new QSGDragAttached(obj);
}
QSGMouseAreaPrivate::QSGMouseAreaPrivate()