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 d72b11c..f2e76de 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 940c8e3..e879596 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 );