diff options
Diffstat (limited to 'benchmarks/auto/creation/quick/delegates_qobject.qml')
-rw-r--r-- | benchmarks/auto/creation/quick/delegates_qobject.qml | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/benchmarks/auto/creation/quick/delegates_qobject.qml b/benchmarks/auto/creation/quick/delegates_qobject.qml index 130d722..ee9bc3d 100644 --- a/benchmarks/auto/creation/quick/delegates_qobject.qml +++ b/benchmarks/auto/creation/quick/delegates_qobject.qml @@ -8,6 +8,7 @@ Benchmark { count: 50; staticCount: 10000; + property var items; onTChanged: { allocate(); } @@ -19,9 +20,15 @@ Benchmark { } function allocate() { + if (items && items.length) { + for (var i=0; i<items.length; ++i) + items[i].destroy(); + } + items = []; + for (var i=0; i<root.count; ++i) { var object = component.createObject(); - object.destroy(); + items.push(object); } } } |