Skip to content

QML: Make notify list thread safe

Testing on my system right now. Not yet integrated upstream in 5.15 branch.

QTBUG: https://bugreports.qt.io/browse/QTBUG-105090?subTaskView=all

QML: Make notify list thread safe

We keep the notifyList itself alive until the QQmlData itself is
deleted. This way any isSignalConnected() called while an
intermediate dtor runs can safely access it. We use atomics to make the
concurrent access to the pointer and the connection mask defined
behavior. However, we never need anything but relaxed semantics when
accessing it.

Pick-to: 5.15 6.2 6.5 6.6
Fixes: QTBUG-105090
Change-Id: I82537be86e5cc33c2a3d76ec639fcbac87eb45ad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 691956654c1acab356ce704c58602cc3a99fabc3)

* asturmlechner 2023-08-12: Resolve conflict with dev branch commit
  c249edb83fa67b3e5f711b28923397e66876182d which introduces a behavior
  change, so cannot be backported. Applied changes logically as if that
  commit never happened.

Also backports this for patch context:

QtQml: Clean up QQmlData ctor

Initialize the "dummy" member even though we never use it. Static
analyzers complain about it and we may appreciate it having a defined
value in the future. Also, initialize other members inline where
possible.

Coverity-Id: 415867
Change-Id: Ie428eb3294d6363afe9d7ab2d2bed6e52df0b304
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 10985a568db8cfb4140140967f7d247627ec4350)

* asturmlechner 2023-08-12: Resolve conflicts with dev branch commits
  10985a568db8cfb4140140967f7d247627ec4350 and
  e5246cafffb93f69a49c133210390c253fcb71f2 and
  d3b3fef5a878d7fd53de6a9f9fff196a273930e3
Edited by Andreas Sturmlechner

Merge request reports