From 9dced099e60c668cf13bfcc80f0687dbd87da4f1 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sat, 16 Mar 2024 15:56:56 -0400 Subject: [PATCH] Fix crash when deleting history items * Fixes #10386 --- src/gui/entry/EntryHistoryModel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/entry/EntryHistoryModel.cpp b/src/gui/entry/EntryHistoryModel.cpp index 618f4328f0..563ab12ce9 100644 --- a/src/gui/entry/EntryHistoryModel.cpp +++ b/src/gui/entry/EntryHistoryModel.cpp @@ -159,9 +159,9 @@ void EntryHistoryModel::deleteIndex(QModelIndex index) auto entry = entryFromIndex(index); if (entry) { beginRemoveRows(QModelIndex(), index.row(), index.row()); - m_historyEntries.removeAll(entry); + m_historyEntries.removeAt(index.row()); m_deletedHistoryEntries << entry; - m_historyModifications.erase(m_historyModifications.begin() + index.row()); + calculateHistoryModifications(); endRemoveRows(); } }