Fixed an issue where quitting the application during a ROM rescan could lead to an unclean shutdown

This commit is contained in:
Leon Styhre 2023-10-18 17:52:28 +02:00
parent c0a2f9f557
commit 35e7cd0b77
2 changed files with 9 additions and 6 deletions

View file

@ -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()

View file

@ -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);