]> git.sesse.net Git - vlc/commitdiff
fixes for crash in Safari plugin when terminating (it actually locks the computer...
authorDamien Fouilleul <damienf@videolan.org>
Wed, 14 Jun 2006 22:49:57 +0000 (22:49 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Wed, 14 Jun 2006 22:49:57 +0000 (22:49 +0000)
- 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
modules/video_output/opengl.c

index 47b83d63532b8249a926c50e2d13a36752acf727..f8b9033e00d9a649180aec8980d07420d5719263 100644 (file)
@@ -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 )
index 3f5d86650c3843a1b60658a50dfcb91ffcaf495b..dd68a639736625abacb59292af00cb3058f56122 100644 (file)
@@ -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 );
 }