diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-05-24 13:19:15 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-05-24 13:39:40 +0200 |
commit | 74632fa02a5bd8653c02a4d84a1bcb6b1d5a88f5 (patch) | |
tree | d05fc5a1e9d6079ad244d1fec91b27431f1bcd01 /src/qml/qml/qqmlbinding_p.h | |
parent | e598f400d88f21b07e8c50c85e367cacea5a5960 (diff) |
Implement QObject ownership policy for QObject JavaScript wrappers
A parent with C++ ownership keeps its children alive. We know that all
QObject wrappers are kept in a QWeakValue inside the QObject's QQmlData.
As the weak values are registered to the MM, we can traverse there and
mark the children if necessary in one extra pass.
The handleReferenceManagement auto-test that covers this was actually
testing the addGCRelationship implementation as well as the overal behavior.
Some of the tests verify that a handle based overload of addGCRelationship
works, so since those tests don't make sense anymore, I've removed them.
Also fixed some cases where the test ran gc(engine) when it should've called
gc() on the specific local QQmlEngine instance used in the test. This worked
in V8 because the GC was "global".
Change-Id: Ib394b46e034b016196804a9e73682507fa791445
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlbinding_p.h')
0 files changed, 0 insertions, 0 deletions