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

Derk-Jan Hartman hartman at videolan.org
Sat May 30 13:28:22 CEST 2009


On 30 mei 2009, at 11:28, Malte Tancred wrote:
> 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.

Hmm, and setting nil fixes those crashes for you ? Interesting. I have  
seen similar crashes on the crashreports list. I guess we will go wild  
with the nil's. It can also mean that the refcounting just messes up  
somewhere....

I'm not too familiar with minimal_macosx, but i'll ask pierre, and it  
looks like this can be committed. Samer for patch1

DJ


> ---
> 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
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>




More information about the vlc-devel mailing list