This commit is contained in:
twinaphex 2020-08-02 20:19:42 +02:00
parent 576679ac05
commit a01a2375a1
6 changed files with 18 additions and 8 deletions

View File

@ -3213,6 +3213,8 @@ static void gl2_free(void *data)
gl2_renderchain_deinit_hw_render(gl, (gl2_renderchain_data_t*)gl->renderchain_data); gl2_renderchain_deinit_hw_render(gl, (gl2_renderchain_data_t*)gl->renderchain_data);
gl2_deinit_chain(gl); gl2_deinit_chain(gl);
if (gl->ctx_driver && gl->ctx_driver->destroy)
gl->ctx_driver->destroy(gl->ctx_data);
video_context_driver_free(); video_context_driver_free();
gl2_destroy_resources(gl); gl2_destroy_resources(gl);

View File

@ -1032,6 +1032,8 @@ static void gl1_gfx_free(void *data)
gl1->extensions = NULL; gl1->extensions = NULL;
font_driver_free_osd(); font_driver_free_osd();
if (gl1->ctx_driver && gl1->ctx_driver->destroy)
gl1->ctx_driver->destroy(gl1->ctx_data);
video_context_driver_free(); video_context_driver_free();
free(gl1); free(gl1);
} }

View File

@ -1545,6 +1545,8 @@ static void gl_core_free(void *data)
gl_core_context_bind_hw_render(gl, false); gl_core_context_bind_hw_render(gl, false);
font_driver_free_osd(); font_driver_free_osd();
gl_core_destroy_resources(gl); gl_core_destroy_resources(gl);
if (gl->ctx_driver && gl->ctx_driver->destroy)
gl->ctx_driver->destroy(gl->ctx_data);
video_context_driver_free(); video_context_driver_free();
} }

View File

@ -309,6 +309,8 @@ static void vg_free(void *data)
vgDestroyPaint(vg->mPaintBg); vgDestroyPaint(vg->mPaintBg);
} }
if (vg->ctx_driver && vg->ctx_driver->destroy)
vg->ctx_driver->destroy(vg->ctx_data);
video_context_driver_free(); video_context_driver_free();
free(vg); free(vg);

View File

@ -972,6 +972,8 @@ static void vulkan_free(void *data)
if (vk->filter_chain) if (vk->filter_chain)
vulkan_filter_chain_free((vulkan_filter_chain_t*)vk->filter_chain); vulkan_filter_chain_free((vulkan_filter_chain_t*)vk->filter_chain);
if (vk->ctx_driver && vk->ctx_driver->destroy)
vk->ctx_driver->destroy(vk->ctx_data);
video_context_driver_free(); video_context_driver_free();
} }

View File

@ -33486,8 +33486,6 @@ const gfx_ctx_driver_t *video_context_driver_init_first(void *data,
void video_context_driver_free(void) void video_context_driver_free(void)
{ {
struct rarch_state *p_rarch = &rarch_st; struct rarch_state *p_rarch = &rarch_st;
if (p_rarch->current_video_context.destroy)
p_rarch->current_video_context.destroy(p_rarch->video_context_data);
video_context_driver_destroy(); video_context_driver_destroy();
p_rarch->video_context_data = NULL; p_rarch->video_context_data = NULL;
} }
@ -33541,12 +33539,14 @@ bool video_context_driver_input_driver(gfx_ctx_input_t *inp)
settings_t *settings = p_rarch->configuration_settings; settings_t *settings = p_rarch->configuration_settings;
const char *joypad_name = settings->arrays.input_joypad_driver; const char *joypad_name = settings->arrays.input_joypad_driver;
if (!p_rarch->current_video_context.input_driver) if (p_rarch && p_rarch->current_video_context.input_driver)
return false; {
p_rarch->current_video_context.input_driver( p_rarch->current_video_context.input_driver(
p_rarch->video_context_data, joypad_name, p_rarch->video_context_data, joypad_name,
inp->input, inp->input_data); inp->input, inp->input_data);
return true; return true;
}
return false;
} }
bool video_context_driver_get_ident(gfx_ctx_ident_t *ident) bool video_context_driver_get_ident(gfx_ctx_ident_t *ident)