mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Ref T579 Work around proximate cause of data race in CListModelBase.
This is still not thread-safe but at least it is less likely to crash. A more robust fix will be attempted later.
This commit is contained in:
@@ -545,10 +545,11 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
// sort the values
|
||||
const auto tieBreakersCopy = m_sortTieBreakers; //! \todo workaround T579 still not thread-safe, but less likely to crash
|
||||
const std::integral_constant<bool, UseCompare> marker {};
|
||||
const auto p = [ = ](const ObjectType & a, const ObjectType & b) -> bool
|
||||
{
|
||||
return Private::compareForModelSort<ObjectType>(a, b, order, propertyIndex, m_sortTieBreakers, marker);
|
||||
return Private::compareForModelSort<ObjectType>(a, b, order, propertyIndex, tieBreakersCopy, marker);
|
||||
};
|
||||
|
||||
return container.sorted(p);
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace BlackGui
|
||||
|
||||
CColumns m_columns; //!< columns metadata
|
||||
int m_sortColumn; //!< currently sorted column
|
||||
bool m_modelDestroyed = false; //!< model is about to be destroyed
|
||||
bool m_modelDestroyed = false; //!< \todo rudimentary workaround for T579, can be removed
|
||||
Qt::SortOrder m_sortOrder; //!< sort order (asc/desc)
|
||||
Qt::DropActions m_dropActions = Qt::IgnoreAction; //!< drop actions
|
||||
BlackMisc::CPropertyIndexList m_sortTieBreakers; //!< how column values are sorted if equal, if no value is given this is random
|
||||
|
||||
Reference in New Issue
Block a user