video_driver_unset_callback - have destroy_callback do this

implicitly
This commit is contained in:
twinaphex 2016-02-07 20:06:07 +01:00
parent 772aa6ef0c
commit 3e69eb5a8e
3 changed files with 3 additions and 12 deletions

View File

@ -530,6 +530,9 @@ void video_driver_callback_destroy_context(void)
(const struct retro_hw_render_callback*)video_driver_callback();
if (hw_render->context_destroy)
hw_render->context_destroy();
memset(&video_driver_state.hw_render_callback, 0,
sizeof(video_driver_state.hw_render_callback));
}
static bool uninit_video_input(void)
@ -537,10 +540,7 @@ static bool uninit_video_input(void)
event_cmd_ctl(EVENT_CMD_OVERLAY_DEINIT, NULL);
if (!video_driver_ctl(RARCH_DISPLAY_CTL_IS_VIDEO_CACHE_CONTEXT, NULL))
{
video_driver_callback_destroy_context();
video_driver_unset_callback();
}
if (
!input_driver_ctl(RARCH_INPUT_CTL_OWNS_DRIVER, NULL) &&
@ -1109,12 +1109,6 @@ struct retro_hw_render_callback *video_driver_callback(void)
return &video_driver_state.hw_render_callback;
}
void video_driver_unset_callback(void)
{
memset(&video_driver_state.hw_render_callback, 0,
sizeof(video_driver_state.hw_render_callback));
}
static bool video_driver_frame_filter(const void *data,
unsigned width, unsigned height,
size_t pitch,

View File

@ -328,7 +328,6 @@ struct aspect_ratio_elem
extern struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END];
bool video_driver_ctl(enum rarch_display_ctl_state state, void *data);
/**
@ -433,7 +432,6 @@ float video_driver_get_aspect_ratio(void);
void video_driver_set_aspect_ratio_value(float value);
struct retro_hw_render_callback *video_driver_callback(void);
void video_driver_unset_callback(void);
void video_driver_callback_destroy_context(void);
rarch_softfilter_t *video_driver_frame_filter_get_ptr(void);

View File

@ -310,7 +310,6 @@ bool core_ctl(enum core_ctl_state state, void *data)
break;
case CORE_CTL_RETRO_UNLOAD_GAME:
video_driver_callback_destroy_context();
video_driver_unset_callback();
core.retro_unload_game();
break;
case CORE_CTL_RETRO_RUN: