diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2023-10-19 10:05:28 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2023-11-22 22:40:39 +0100 |
commit | 7461ae2a946321576f6a495df33e3a17639e246c (patch) | |
tree | 9d824d0cff22804097f5e7814df1f391fe501f3b /tests/auto/qml/qqmlcontext | |
parent | b9be154316ddd4633ffeab6cbfdbcac847237ba5 (diff) |
Prepare tests for upcoming incremental gc
This commit:
- Introduces helper functions gcDone and gc. gcDone simply returns true
as the gc is currently not incremental. gc is a helper method which
has been copied into various tests already, which runs the garbage
collections and sends events to clean up objects scheduled for
deletion. The new helpers are placed in qmlutils.cpp.
- It adds a flag to gc which allows not sending the posted events. That
allows using gc in more places, while highlighting the fact that we
don't want to process events at this point. This will also help
upcoming changes to the incremental gc, which by default will use the
event loop to drive the gc processing
- It moves some gc calls from QML to C++ – this again will help later to
ensure that the gc actually has completed
As a driveby, the logging rules early in tst_qv4mm are reset earlier.
Task-number: QTBUG-119274
Change-Id: I75d6ffcb3aa459b020e8257155faa91c39653d43
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlcontext')
-rw-r--r-- | tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp index 2e6626c08d..70728cf03f 100644 --- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp +++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp @@ -824,7 +824,7 @@ void tst_qqmlcontext::contextLeak() scriptContext = scriptContextWrapper->as<QV4::QQmlContextWrapper>()->getContext(); } - engine.collectGarbage(); + gc(engine); // Each time a JS file (non-pragma-shared) is imported, we create a QQmlContext(Data) for it. // Make sure that context does not leak. |