[vlc-devel] [PATCH 2/2] Made VLCKit's VLCOpenGLVoutView ignore -reshape requests when quit is in progress, thus avoiding a segfault.

Malte Tancred malte at frontbase.com
Sat May 30 11:28:18 CEST 2009


The changes to VLCOpenGLVoutView was made to avoid a segfault in  
objc_msgSend that occurred as a side-effect of sending - 
removeFromSuperview to the VLCVideoView. This patch might just be  
treating symptoms, but it didn't seem right to go through with all the  
code in -reshape if we're in the process of closing down. The segfault  
happened on the first line of cocoaglvoutviewLock() in  
VLCOpenGLVoutView.m, where I guess either p_vout->p_sys->o_glview or  
its -openGLContext pointed to something bad. I'm not sure checking  
p_vout->b_die is the right way to go either.
---
  modules/gui/minimal_macosx/VLCOpenGLVoutView.m |    9 ++++++++-
  1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/modules/gui/minimal_macosx/VLCOpenGLVoutView.m b/modules/ 
gui/minimal_macosx/VLCOpenGLVoutView.m
index bb3b1c5..878ecfb 100644
--- a/modules/gui/minimal_macosx/VLCOpenGLVoutView.m
+++ b/modules/gui/minimal_macosx/VLCOpenGLVoutView.m
@@ -96,9 +96,10 @@ void cocoaglvoutviewEnd( vout_thread_t * p_vout )
          [o_cocoaglview_container removeVoutSubview: p_vout->p_sys- 
 >o_glview];

      [p_vout->p_sys->o_glview release];
+    p_vout->p_sys->o_glview = nil;

      [p_vout->p_sys->o_pool release];
-
+    p_vout->p_sys->o_pool = nil;
  }

  / 
*****************************************************************************
@@ -305,6 +306,12 @@ void cocoaglvoutviewUnlock( vout_thread_t *  
p_vout )
          return;
      }

+    if( p_vout->b_die )
+    {
+        [objectLock unlock];
+        return;
+    }
+
      cocoaglvoutviewLock( p_vout );
      NSRect bounds = [self bounds];

-- 
1.6.2.1




More information about the vlc-devel mailing list