From 7a6b8a51f8b06684d32ba3a4985230363c32d8b0 Mon Sep 17 00:00:00 2001 From: Damien Fouilleul Date: Wed, 14 Jun 2006 22:49:57 +0000 Subject: [PATCH] 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 --- modules/gui/macosx/voutgl.m | 2 +- modules/video_output/opengl.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/gui/macosx/voutgl.m b/modules/gui/macosx/voutgl.m index 47b83d6353..f8b9033e00 100644 --- a/modules/gui/macosx/voutgl.m +++ b/modules/gui/macosx/voutgl.m @@ -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 ) diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c index 3f5d86650c..dd68a63973 100644 --- a/modules/video_output/opengl.c +++ b/modules/video_output/opengl.c @@ -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 ); } -- 2.39.5