From 5b2aa9926f04ab861cf3b0bb144b468ece268ec6 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 26 Mar 2023 18:50:14 +0000 Subject: [PATCH] Robustness and warning fixes. --- src/gui/main.cc | 13 ++++++++++--- src/gui/mainwindow.cc | 3 +++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/gui/main.cc b/src/gui/main.cc index 324fdecb..854f0c35 100644 --- a/src/gui/main.cc +++ b/src/gui/main.cc @@ -122,9 +122,16 @@ bool FluxEngineApp::IsWorkerThreadRunning() const void FluxEngineApp::OnExec(const ExecEvent& event) { - event.RunCallback(); - if (event.IsSynchronous()) - execSemaphore.Post(); + try + { + event.RunCallback(); + if (event.IsSynchronous()) + execSemaphore.Post(); + } + catch (std::exception& e) + { + std::cerr << "Unhandled exception: " << e.what() << "\n"; + } } void runOnUiThread(std::function callback) diff --git a/src/gui/mainwindow.cc b/src/gui/mainwindow.cc index 543a51b4..1881a7f6 100644 --- a/src/gui/mainwindow.cc +++ b/src/gui/mainwindow.cc @@ -481,6 +481,9 @@ public: visualiser->Clear(); _filesystemModel->Clear(Path()); _currentDisk = nullptr; + _filesystemCapabilities = 0; + _filesystemIsReadOnly = true; + _filesystemNeedsFlushing = false; _state = STATE_BROWSING_WORKING; UpdateState();