[VFS] Clear registered devices if launch failed
This commit is contained in:
parent
ff692589c7
commit
a688f87f55
|
@ -1740,6 +1740,8 @@ xe::X_STATUS EmulatorWindow::RunTitle(std::filesystem::path path_to_file) {
|
|||
xe::ui::ImGuiDialog::ShowMessageBox(
|
||||
imgui_drawer_.get(), "Title Launch Failed!",
|
||||
"Failed to launch title.\n\nCheck xenia.log for technical details.");
|
||||
|
||||
emulator_->file_system()->Clear();
|
||||
} else {
|
||||
AddRecentlyLaunchedTitle(path_to_file, emulator_->title_name());
|
||||
|
||||
|
|
|
@ -27,6 +27,10 @@ VirtualFileSystem::VirtualFileSystem() {}
|
|||
VirtualFileSystem::~VirtualFileSystem() {
|
||||
// Delete all devices.
|
||||
// This will explode if anyone is still using data from them.
|
||||
Clear();
|
||||
}
|
||||
|
||||
void VirtualFileSystem::Clear() {
|
||||
devices_.clear();
|
||||
symlinks_.clear();
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ class VirtualFileSystem {
|
|||
VirtualFileSystem();
|
||||
~VirtualFileSystem();
|
||||
|
||||
void Clear();
|
||||
|
||||
bool RegisterDevice(std::unique_ptr<Device> device);
|
||||
bool UnregisterDevice(const std::string_view path);
|
||||
|
||||
|
|
Loading…
Reference in New Issue