forked from qt-creator/qt-creator
Fix crash when removing built-in snippets
Snippets collection managed the snippets with persistent iterators to the "end" of the active snippets. Qt 5's QList was nicely updating iterators even on non-const operations, but that has changed in Qt 6. Don't use iterators, simply work with the count of active items. Fixes: QTCREATORBUG-26648 Task-number: QTCREATORBUG-24098 Change-Id: Icc13274daf0e87d0562d80d7bc763c863d5da075 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -121,7 +121,7 @@ private:
|
||||
// active. Specifically, removed built-in snippets are kept as the last ones (for each
|
||||
// group there is a iterator that marks the logical end).
|
||||
QVector<QList<Snippet> > m_snippets;
|
||||
QVector<QList<Snippet>::iterator> m_activeSnippetsEnd;
|
||||
QVector<int> m_activeSnippetsCount;
|
||||
|
||||
QHash<QString, int> m_groupIndexById;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user