Skip to content

Commit

Permalink
Fix early-use crash in folder watcher on Linux
Browse files Browse the repository at this point in the history
In a few error scenarios (out-of-memory or out-of-space), the folder
watcher on Linux shows a dialog with an error message. If this occurs
during start-up before the GUI is initialised, this will lead to a
crash.

This is fixed by delaying the VFS start until after event loop is
started, guaranteeing that the GUI is up and running.

Fixes: #11460
  • Loading branch information
erikjv authored and TheOneRing committed Jan 17, 2024
1 parent 5638dea commit 82c7a2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ Folder::Folder(const FolderDefinition &definition, const AccountStatePtr &accoun

// Potentially upgrade suffix vfs to windows vfs
OC_ENFORCE(_vfs);
// Initialize the vfs plugin
startVfs();
// Initialize the vfs plugin. Do this after the UI is running, so we can show a dialog when something goes wrong.
QTimer::singleShot(0, this, &Folder::startVfs);
}
}

Expand Down

0 comments on commit 82c7a2e

Please sign in to comment.