Java methods of QtAbstractItemModel may get called from Qt GUI thread or Java main thread. Situation is the same with internal proxy methods, where they may directly or indirectly called from these two thread. At the same time, a chain of calls may happen from these threads, so some functions may get called indirectly from a single caller thread. In this change, we are adding a map of QObject* to QRecursiveMutux where the QObject is a QAbstractItemModel, either the proxy instance or a reference to an underlaying QAbstractItemModel when the model is implemented in C++. Each call to any function locks the QRecursiveMutux instance associated with the QAbstractItemModel instance. A connection from QObject::destroyed to a lamda, helps to remove the map entry when the model is destroyed. Pick-to: 6.8 Fixes: QTBUG-127467 Change-Id: I18dcdc207e201b3883526648b4e672e5868ed8ab Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit bf76387507dde71063ebe484bce1e7d1b8e09bc2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%