Commit 7a6b8a51 authored by Damien Fouilleul's avatar Damien Fouilleul

fixes for crash in Safari plugin when terminating (it actually locks the...

fixes for crash in Safari plugin when terminating (it actually locks the computer completely on some occasion)
- opengl.c: let End destroy elements created by Init, DestroyVout for CreateVout
- voutgl.m: set context to NULL on exit
parent 350045b4
......@@ -470,7 +470,7 @@ static int aglInit( vout_thread_t * p_vout )
static void aglEnd( vout_thread_t * p_vout )
{
aglSetCurrentContext(p_vout->p_sys->agl_ctx);
aglSetCurrentContext(NULL);
}
static void aglReshape( vout_thread_t * p_vout )
......
......@@ -433,6 +433,7 @@ static int Init( vout_thread_t *p_vout )
glDisable(GL_DEPTH_TEST);
glDepthMask(GL_FALSE);
glDisable(GL_CULL_FACE);
glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
glClear( GL_COLOR_BUFFER_BIT );
/* Check if the user asked for useless visual effects */
......@@ -533,6 +534,11 @@ static void End( vout_thread_t *p_vout )
glFinish();
glFlush();
/* Free the texture buffer*/
glDeleteTextures( 2, p_sys->p_textures );
if( p_sys->pp_buffer[0] ) free( p_sys->pp_buffer[0] );
if( p_sys->pp_buffer[1] ) free( p_sys->pp_buffer[1] );
if( p_sys->p_vout->pf_unlock )
{
p_sys->p_vout->pf_unlock( p_sys->p_vout );
......@@ -553,12 +559,6 @@ static void DestroyVout( vlc_object_t *p_this )
vlc_object_detach( p_sys->p_vout );
vlc_object_destroy( p_sys->p_vout );
/* Free the texture buffer*/
if( p_sys->pp_buffer[0] ) free( p_sys->pp_buffer[0] );
if( p_sys->pp_buffer[1] ) free( p_sys->pp_buffer[1] );
glDeleteTextures( 2, p_sys->p_textures );
free( p_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