diff options
author | Liang Qi <liang.qi@qt.io> | 2016-06-16 07:09:18 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-06-16 07:09:19 +0200 |
commit | 34956bc234bf1b2ebcf224a256297293ba4276aa (patch) | |
tree | 732fc88b9ea113e8ff3f106a5e5bc33610c5ed57 /tests/auto/qml | |
parent | e3a6565c3832e6f3001d49c52ca59fa4fa555f1b (diff) | |
parent | 210617de78c78af44efdc251ba7a207c5c26e11c (diff) |
Merge remote-tracking branch 'origin/5.7.0' into 5.7
Change-Id: I7b0ad528da17ecdb955c2d0c792c9f113904623e
Diffstat (limited to 'tests/auto/qml')
-rw-r--r-- | tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp index ef1ea3a897..3e8e1d23ea 100644 --- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp +++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp @@ -81,10 +81,19 @@ void tst_QQMLTypeLoader::trimCache() url.setQuery(QString::number(i)); QQmlTypeData *data = loader.getType(url); - if (i % 5 == 0) // keep references to some of them so that they aren't trimmed - data->compiledData()->addref(); + // Run an event loop to receive the callback that release()es. + QTRY_COMPARE(data->count(), 2); - data->release(); + // keep references to some of them so that they aren't trimmed. References to either the + // QQmlTypeData or its compiledData() should prevent the trimming. + if (i % 10 == 0) { + // keep ref on data, don't add ref on data->compiledData() + } else if (i % 5 == 0) { + data->compiledData()->addref(); + data->release(); + } else { + data->release(); + } } for (int i = 0; i < 256; ++i) { |