mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kate: use QMutableListIterator<T> for iteration in KateCompletionWidget::startCompletion()
another iterator modified the wrong way, fixes possible crash Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
6de2404970
commit
b8cd7e451e
1 changed files with 4 additions and 2 deletions
|
@ -352,7 +352,9 @@ void KateCompletionWidget::startCompletion(const KTextEditor::Range& word, const
|
|||
deleteCompletionRanges();
|
||||
}
|
||||
|
||||
foreach (KTextEditor::CodeCompletionModel* model, models) {
|
||||
QMutableListIterator<KTextEditor::CodeCompletionModel*> modelsit(models);
|
||||
while (modelsit.hasNext()) {
|
||||
KTextEditor::CodeCompletionModel* model = modelsit.next();
|
||||
KTextEditor::Range range;
|
||||
if (word.isValid()) {
|
||||
range = word;
|
||||
|
@ -369,7 +371,7 @@ void KateCompletionWidget::startCompletion(const KTextEditor::Range& word, const
|
|||
m_completionRanges.remove(model);
|
||||
delete oldRange;
|
||||
}
|
||||
models.removeAll(model);
|
||||
modelsit.remove();
|
||||
continue;
|
||||
}
|
||||
if(m_completionRanges.contains(model)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue