[vlc-devel] commit: Force new not to throw. Also drop a separate declaration of a static function that' s called exactly once, and mark it inline instead. (JP Dinger )

Rémi Denis-Courmont remi at remlab.net
Mon Jun 22 18:57:04 CEST 2009


Le vendredi 19 juin 2009 00:48:32 git version control, vous avez écrit :
> @@ -179,8 +178,11 @@ static int Open( vlc_object_t *p_this )
>
>      vlc_mutex_init( &p_sys->lock );
>
> -    /* Init the variables *//* Add the callbacks */
> -    p_sys->p_reverbm = new revmodel();
> +    /* Force new to return 0 on failure instead of throwing, since we
> don't +       want an exception to leak back to C code. Bad things would
> happen. */ +    p_sys->p_reverbm = new (nothrow) revmodel;
> +    if( !p_sys->p_reverbm )
> +        return VLC_ENOMEM;

You're visibly leaking a lock here. Maybe some other stuff.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list