Skip to content

Commit 04c9b33

Browse files
committed
Coalesce the removeDownload reset with the following refreshList
Moves the ModelResetGuard out of the try-catch so it also wraps the refreshList() call below. Without this, one reset fires when the guard destructs at the end of the try block and another fires from refreshList's own guard, producing two resets where one is sufficient.
1 parent ce2068f commit 04c9b33

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/downloadmanager.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,10 +914,11 @@ void DownloadManager::removeDownload(int index, bool deleteFile)
914914
return;
915915
}
916916

917+
// coalesce the removal and the subsequent refresh into one reset
918+
ModelResetGuard guard(*this);
919+
917920
try {
918921
DirWatcherManager::Guard dirWatcherGuard = m_DirWatcher.scopedGuard();
919-
// coalesce the removal and the subsequent refresh into one reset
920-
ModelResetGuard guard(*this);
921922

922923
if (index < 0) {
923924
bool removeAll = (index == -1);

0 commit comments

Comments
 (0)