Commit fca90e83 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

opengl: release current context before destroying it

parent 77c14051
......@@ -158,7 +158,10 @@ static int Open (vlc_object_t *obj)
const vlc_fourcc_t *spu_chromas;
sys->vgl = vout_display_opengl_New (&vd->fmt, &spu_chromas, sys->gl);
if (!sys->vgl)
vlc_gl_ReleaseCurrent (sys->gl);
goto error;
vd->sys = sys;
vd->info.has_pictures_invalid = false;
......@@ -189,6 +192,8 @@ static void Close (vlc_object_t *obj)
vout_display_sys_t *sys = vd->sys;
vout_display_opengl_Delete (sys->vgl);
vlc_gl_ReleaseCurrent (sys->gl);
vlc_gl_Destroy (sys->gl);
vout_display_DeleteWindow (vd, sys->window);
free (sys);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment