]> git.sesse.net Git - vlc/commitdiff
macosx/vout*: fixed a possible segfault on vout close
authorEric Petit <titer@videolan.org>
Tue, 18 May 2004 09:08:44 +0000 (09:08 +0000)
committerEric Petit <titer@videolan.org>
Tue, 18 May 2004 09:08:44 +0000 (09:08 +0000)
modules/gui/macosx/vout.h
modules/gui/macosx/vout.m

index d72b11c8834fec968192647b4d9ec7b107628d16..f2e76de19cfaaa26bc37f641c01f107a05a919ed 100644 (file)
     int               initDone;
 }
 
-- (id) initWithFrame: (NSRect) frame vout: (vout_thread_t*) p_vout;
+- (id)   initWithFrame: (NSRect) frame vout: (vout_thread_t*) p_vout;
 - (void) initTextures;
 - (void) reloadTexture: (int) index;
+- (void) cleanUp;
 
 @end
 
index 940c8e36a15d4b191ad871156d0f87844a60bc26..e87959626db7f6d10183e6ac410ddca67b6f1d1e 100644 (file)
@@ -455,6 +455,11 @@ void E_(CloseVideo) ( vlc_object_t *p_this )
 {       
     vout_thread_t * p_vout = (vout_thread_t *)p_this;     
 
+    if( p_vout->p_sys->i_opengl )
+    {
+        [p_vout->p_sys->o_glview cleanUp];
+    }
+
     if( CoDestroyWindow( p_vout ) )
     {
         msg_Err( p_vout, "unable to destroy window" );
@@ -1588,6 +1593,11 @@ CATCH_MOUSE_EVENTS
             p_vout->p_sys->p_data[index] );
 }
 
+- (void) cleanUp
+{
+    initDone = 0;
+}
+
 - (void) drawQuad
 {
     glBegin( GL_QUADS );