From ee0ce302011e37cc29b25f2be13b89fea2d4b2e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Thu, 31 Mar 2022 09:29:29 +0200 Subject: [PATCH] fixed a crash caused by scene indexes deleted in ascending order --- src/document/UBDocumentController.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 133f3975..104c1dfd 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -3649,6 +3649,7 @@ void UBDocumentController::deletePages(QList itemsToDelete) UBDocumentContainer::deletePages(sceneIndexes); if (mBoardController->selectedDocument() == selectedDocument()) { + std::sort(sceneIndexes.begin(), sceneIndexes.end(), std::greater<>()); for (auto index : sceneIndexes) mBoardController->deleteThumbPage(index); }