diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-29 05:26:30 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-29 05:27:56 (GMT) |
commit | 28bd5d733ba1b0eedd3fff24ad42ab0e5e87a2e6 (patch) | |
tree | cddf3369bcf41416aa097d412df5fa63ba3a0d85 /src | |
parent | c9375c40656e226a985ba73e7c45d2f7a4ea75ab (diff) | |
download | Qt-28bd5d733ba1b0eedd3fff24ad42ab0e5e87a2e6.zip Qt-28bd5d733ba1b0eedd3fff24ad42ab0e5e87a2e6.tar.gz Qt-28bd5d733ba1b0eedd3fff24ad42ab0e5e87a2e6.tar.bz2 |
Optimization: reduce allocations
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qdeclarativevmemetaobject.cpp | 6 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativevmemetaobject_p.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp index 721e1f1..9a7bdd6 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject.cpp +++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp @@ -396,6 +396,7 @@ QDeclarativeVMEMetaObject::QDeclarativeVMEMetaObject(QObject *obj, methodOffset = QAbstractDynamicMetaObject::methodOffset(); data = new QDeclarativeVMEVariant[metaData->propertyCount]; + aConnected.resize(metaData->aliasCount); int list_type = qMetaTypeId<QDeclarativeListProperty<QObject> >(); @@ -403,7 +404,7 @@ QDeclarativeVMEMetaObject::QDeclarativeVMEMetaObject(QObject *obj, for (int ii = 0; ii < metaData->propertyCount; ++ii) { int t = (metaData->propertyData() + ii)->propertyType; if (t == list_type) { - listProperties.append(new List(methodOffset + ii)); + listProperties.append(List(methodOffset + ii)); data[ii].setValue(listProperties.count() - 1); } } @@ -413,7 +414,6 @@ QDeclarativeVMEMetaObject::~QDeclarativeVMEMetaObject() { compiledData->release(); delete parent; - qDeleteAll(listProperties); delete [] data; delete [] methods; } @@ -505,7 +505,7 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) } if (t == qMetaTypeId<QDeclarativeListProperty<QObject> >()) { int listIndex = data[id].asInt(); - const List *list = listProperties.at(listIndex); + const List *list = &listProperties.at(listIndex); *reinterpret_cast<QDeclarativeListProperty<QObject> *>(a[0]) = QDeclarativeListProperty<QObject>(object, (void *)list, list_append, list_count, list_at, diff --git a/src/declarative/qml/qdeclarativevmemetaobject_p.h b/src/declarative/qml/qdeclarativevmemetaobject_p.h index 4718fa7..839f0cd 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject_p.h +++ b/src/declarative/qml/qdeclarativevmemetaobject_p.h @@ -158,7 +158,7 @@ private: List(int lpi) : notifyIndex(lpi) {} int notifyIndex; }; - QList<List *> listProperties; + QList<List> listProperties; static void list_append(QDeclarativeListProperty<QObject> *, QObject *); static int list_count(QDeclarativeListProperty<QObject> *); |