From 35e7cd0b77e3c6aebb5363ea154ef1e8e6e0195e Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 18 Oct 2023 17:52:28 +0200 Subject: [PATCH] Fixed an issue where quitting the application during a ROM rescan could lead to an unclean shutdown --- es-app/src/guis/GuiMenu.cpp | 12 +++++++----- es-app/src/views/ViewController.cpp | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 7d68741c4..8b0606a1f 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -91,12 +91,14 @@ GuiMenu::GuiMenu() GuiMenu::~GuiMenu() { - // This is required for the situation where scrolling started just before the menu - // was openened. Without this, the scrolling would run until manually stopped after - // the menu has been closed. - ViewController::getInstance()->stopScrolling(); + if (ViewController::getInstance()->getState().viewing != ViewController::ViewMode::NOTHING) { + // This is required for the situation where scrolling started just before the menu + // was openened. Without this, the scrolling would run until manually stopped after + // the menu has been closed. + ViewController::getInstance()->stopScrolling(); - ViewController::getInstance()->startViewVideos(); + ViewController::getInstance()->startViewVideos(); + } } void GuiMenu::openScraperOptions() diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index 377bfdfcb..88bf5e1d7 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -1409,13 +1409,14 @@ void ViewController::reloadAll() void ViewController::rescanROMDirectory() { mWindow->setBlockInput(true); + resetCamera(); + mState.viewing = ViewMode::NOTHING; mGamelistViews.clear(); mSystemListView.reset(); mCurrentView.reset(); mPreviousView.reset(); mSkipView.reset(); - resetCamera(); mWindow->renderSplashScreen(Window::SplashScreenState::SCANNING, 0.0f); CollectionSystemsManager::getInstance()->deinit(false);