aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativeengine.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-12-21 18:44:26 +0000
committerQt by Nokia <qt-info@nokia.com>2011-12-22 12:06:03 +0100
commit5c22d958fb7cd5e9729518a6fdd0a9a18a9a7481 (patch)
tree84de5cd638d6abc06e27952e289f1fd03b97cc05 /src/declarative/qml/qdeclarativeengine.cpp
parent38a6e710199c13b8b7c9b3a1be67a3088f8b5570 (diff)
Reserve enough space in the QDeclarativePropertyCache hash
It was too easy for callers of copy() to pass the wrong reserve size, so a new copyAndAppend() method has been added to reduce error. Change-Id: If2f13e2e0733e5d87c527934dc5a6c8d0c8df572 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/qml/qdeclarativeengine.cpp')
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 9f2f4a0a09..2b77fe536d 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -1575,10 +1575,7 @@ QDeclarativePropertyCache *QDeclarativeEnginePrivate::createCache(const QMetaObj
return rv;
} else {
QDeclarativePropertyCache *super = cache(mo->superClass());
- QDeclarativePropertyCache *rv = super->copy(mo->propertyCount() + mo->methodCount() -
- mo->superClass()->propertyCount() -
- mo->superClass()->methodCount());
- rv->append(q, mo);
+ QDeclarativePropertyCache *rv = super->copyAndAppend(q, mo);
propertyCache.insert(mo, rv);
return rv;
}