Menu context destroy needs to be grouped in HAVE_MENU ifdef

This commit is contained in:
twinaphex 2014-06-02 22:00:33 +02:00
parent 12a63a7bc8
commit 07db4ea692

View File

@ -569,7 +569,8 @@ void init_drivers(void)
#ifdef HAVE_MENU
init_menu();
if (driver.menu_ctx && driver.menu_ctx->context_reset)
if (driver.menu && driver.menu_ctx && driver.menu_ctx->context_reset)
driver.menu_ctx->context_reset(driver.menu);
#endif
@ -635,10 +636,10 @@ void uninit_drivers(void)
if (g_extern.system.hw_render_callback.context_destroy && !driver.video_cache_context)
g_extern.system.hw_render_callback.context_destroy();
#ifdef HAVE_MENU
if (driver.menu && driver.menu_ctx && driver.menu_ctx->context_destroy)
driver.menu_ctx->context_destroy(driver.menu);
#ifdef HAVE_MENU
if (!driver.menu_data_own)
{
menu_free(driver.menu);