mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Fixed some potential segfaults on emergency shutdown.
This commit is contained in:
parent
f80658696c
commit
c3dbdd431c
|
@ -227,6 +227,10 @@ void ViewController::invalidAlternativeEmulatorDialog()
|
|||
|
||||
void ViewController::goToStart(bool playTransition)
|
||||
{
|
||||
// Needed to avoid segfaults during emergency shutdown.
|
||||
if (Renderer::getSDLWindow() == nullptr)
|
||||
return;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
// The startup animations are very choppy on macOS as of moving to SDL 2.0.18 so the
|
||||
// best user experience is to simply disable them on this OS.
|
||||
|
@ -310,6 +314,9 @@ void ViewController::cancelViewTransitions()
|
|||
|
||||
void ViewController::stopScrolling()
|
||||
{
|
||||
if (Renderer::getSDLWindow() == nullptr)
|
||||
return;
|
||||
|
||||
mSystemListView->stopScrolling();
|
||||
mCurrentView->stopListScrolling();
|
||||
|
||||
|
@ -1031,6 +1038,9 @@ void ViewController::reloadGameListView(IGameListView* view, bool reloadTheme)
|
|||
|
||||
void ViewController::reloadAll()
|
||||
{
|
||||
if (Renderer::getSDLWindow() == nullptr)
|
||||
return;
|
||||
|
||||
cancelViewTransitions();
|
||||
|
||||
// Clear all GameListViews.
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "Log.h"
|
||||
#include "MameNames.h"
|
||||
#include "Settings.h"
|
||||
#include "renderers/Renderer.h"
|
||||
#include "Window.h"
|
||||
#include "utils/StringUtil.h"
|
||||
|
||||
#include <SDL2/SDL_events.h>
|
||||
|
@ -270,8 +270,7 @@ void emergencyShutdown()
|
|||
{
|
||||
LOG(LogError) << "Critical - Performing emergency shutdown...";
|
||||
|
||||
// Most of the SDL deinitialization is done in Renderer.
|
||||
Renderer::deinit();
|
||||
Window::getInstance()->deinit();
|
||||
Log::flush();
|
||||
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
Loading…
Reference in a new issue