FolderStatusModel: Fix crash when there is an error while expanding folders
authorOlivier Goffart <ogoffart@woboq.com>
Thu, 31 May 2018 09:00:11 +0000 (11:00 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:57:55 +0000 (10:57 +0100)
commit0d21936e9576a3a0e8e7ba882cb9f152be9afb38
treedf97717d52350deeb3a099d9edd152ec0468654e
parentcf3846c565f201d44935332507579ca5a43fd5e3
FolderStatusModel: Fix crash when there is an error while expanding folders

In FolderStatusModel::slotLscolFinishedWithError, the call to parentInfo->resetSubs
deleted the 'job' and the reply 'r' which we accessed later to get the error code.

Fix this problem twice by
 1) Get the error code before caling resetSubs
 2) in FolderStatusModel::SubFolderInfo::resetSubs, call deleteLater instead of delete

Regression introduced in commit d69936e0

Issue #6562
src/gui/folderstatusmodel.cpp