aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativecompiler.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/qdeclarativecompiler.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/qdeclarativecompiler.cpp')
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 10e64b34df..faaebc0f82 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -3121,11 +3121,12 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn
}
if (obj->type != -1) {
- QDeclarativePropertyCache *cache = output->types[obj->type].createPropertyCache(engine)->copy();
- cache->append(engine, &obj->extObject,
- QDeclarativePropertyData::NoFlags,
- QDeclarativePropertyData::IsVMEFunction,
- QDeclarativePropertyData::IsVMESignal);
+ QDeclarativePropertyCache *superCache = output->types[obj->type].createPropertyCache(engine);
+ QDeclarativePropertyCache *cache =
+ superCache->copyAndAppend(engine, &obj->extObject,
+ QDeclarativePropertyData::NoFlags,
+ QDeclarativePropertyData::IsVMEFunction,
+ QDeclarativePropertyData::IsVMESignal);
// now we modify the flags appropriately for var properties.
int propertyOffset = obj->extObject.propertyOffset();