From 72d58d318a42ba39ccdfe7818bb106f6f8aa929b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 8 Feb 2019 04:49:59 +0100 Subject: [PATCH] Prevent crash at exit on OSX --- menu/drivers/rgui.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index e601c33c5c..a0a2702642 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -1917,7 +1917,7 @@ static void rgui_navigation_clear(void *data, bool pending_push) rgui->scroll_y = 0; } -static const char *rgui_thumbnail_ident() +static const char *rgui_thumbnail_ident(void) { char folder = 0; settings_t *settings = config_get_ptr(); @@ -2231,6 +2231,13 @@ static void rgui_toggle(void *userdata, bool menu_on) { settings_t *settings = config_get_ptr(); + /* TODO/FIXME - when we close RetroArch, this function + * gets called and settings is NULL at this point. + * Maybe fundamentally change control flow so that on RetroArch + * exit, this doesn't get called. */ + if (!settings) + return; + if (settings->bools.menu_rgui_lock_aspect) { if (menu_on) @@ -2246,9 +2253,7 @@ static void rgui_toggle(void *userdata, bool menu_on) else { if (settings->uints.video_aspect_ratio_idx != ASPECT_RATIO_4_3) - { video_driver_set_aspect_ratio(); - } } } }