mirror of https://github.com/mpv-player/mpv
vo_gpu: explicitly set target_params to NULL on uninit
Prevents vo_get_target_params from segfaulting if called somewhere else in the code since the underlying p->renderer was just freed.
This commit is contained in:
parent
2827c9f323
commit
8039128693
|
@ -279,6 +279,10 @@ static void uninit(struct vo *vo)
|
||||||
struct gpu_priv *p = vo->priv;
|
struct gpu_priv *p = vo->priv;
|
||||||
|
|
||||||
gl_video_uninit(p->renderer);
|
gl_video_uninit(p->renderer);
|
||||||
|
mp_mutex_lock(&vo->params_mutex);
|
||||||
|
vo->target_params = NULL;
|
||||||
|
mp_mutex_unlock(&vo->params_mutex);
|
||||||
|
|
||||||
if (vo->hwdec_devs) {
|
if (vo->hwdec_devs) {
|
||||||
hwdec_devices_set_loader(vo->hwdec_devs, NULL, NULL);
|
hwdec_devices_set_loader(vo->hwdec_devs, NULL, NULL);
|
||||||
hwdec_devices_destroy(vo->hwdec_devs);
|
hwdec_devices_destroy(vo->hwdec_devs);
|
||||||
|
|
Loading…
Reference in New Issue