Skip to content

Commit

Permalink
Fix crash in PropagateRemoteMkdir
Browse files Browse the repository at this point in the history
Fixes: #9170
  • Loading branch information
TheOneRing committed Nov 19, 2021
1 parent 45d631f commit eef6ca7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/9170
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Crash when handling locked files

We fixed a crash that could occur when trying to add a locked folder to the databse.


https://github.com/owncloud/client/issues/9170
7 changes: 4 additions & 3 deletions src/libsync/propagateremotemkdir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,13 @@ void PropagateRemoteMkdir::success()
done(SyncFileItem::FatalError, result->error());
});

watcher->setFuture(QtConcurrent::run([p = propagator(), itemCopy] {
// make sure job still exists, the concurrent run might still be ongoing after the job was killed
watcher->setFuture(QtConcurrent::run([job = QPointer<PropagateRemoteMkdir>(this), itemCopy] {
// Try to update the meta data with a 30s timeout
const auto start = std::chrono::steady_clock::now();
while ((std::chrono::steady_clock::now() - start) < UpdateMetaDataRetyTimeOut) {
while (job && (std::chrono::steady_clock::now() - start) < UpdateMetaDataRetyTimeOut) {
QThread::sleep(1);
auto result = std::make_shared<resultType>(p->updateMetadata(itemCopy));
auto result = std::make_shared<resultType>(job->propagator()->updateMetadata(itemCopy));
if (*result) {
if (result->get() == Vfs::ConvertToPlaceholderResult::Locked) {
continue;
Expand Down

0 comments on commit eef6ca7

Please sign in to comment.