fix sweep step for tainted QObject JavaScript wrappers
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sun, 13 Feb 2022 18:04:16 +0000 (18:04 +0000)
committerDmitry Shachnev <mitya57@debian.org>
Sun, 13 Feb 2022 18:04:16 +0000 (18:04 +0000)
commit40e735ded504517acff1cb449b8cf0f5e9e0d6ca
treea877d31b6dfdbc8b8ac8e21c446eac6638f36f1b
parenta4155a231c6c2dcfc31e67e17440f2c8e1d646a5
fix sweep step for tainted QObject JavaScript wrappers

Origin: upstream, https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=e6b2f88d892dcf39
Last-Update: 2022-02-13

Currently, whenever the garbage collector runs, it will destroy all
valid tainted wrappers.

Only null or undefined wrappers will be preserved in the
m_multiplyWrappedQObjects map.

It seems like "!" was overlooked in
3b5d37ce3841c4bfdf1c629d33f0e33b881b47fb. Prior to that change, it
was "!it.value()->markBit()", so calling erase() in the then branch
did make sense. But with "!it.value().isNullOrUndefined()", erase()
will be called for every valid wrapper, which is the opposite what we
want.

Gbp-Pq: Name fix_sweep_step.patch
src/qml/memory/qv4mm.cpp
tests/auto/qml/qjsengine/tst_qjsengine.cpp
tests/auto/qml/qv4mm/tst_qv4mm.cpp