[Spice-devel] [PATCH 02/18] worker: remove current_add assert

Jonathon Jongsma jjongsma at redhat.com
Wed Nov 18 13:54:42 PST 2015


Not much value in this change at the moment. Both versions will result in an
abort by default. I think in this case, it's better to avoid the abort since
this function has a way to indicate failure (by returning FALSE). So I'd suggest
converting this one to g_return_val_if_fail().



On Wed, 2015-11-18 at 16:17 +0000, Frediano Ziglio wrote:
> From: Marc-André Lureau <marcandre.lureau at gmail.com>
> 
> ---
>  server/display-channel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/display-channel.c b/server/display-channel.c
> index d4fcc7e..aed2080 100644
> --- a/server/display-channel.c
> +++ b/server/display-channel.c
> @@ -736,7 +736,7 @@ static int current_add(DisplayChannel *display, Ring
> *ring, Drawable *drawable)
>      RingItem *exclude_base = NULL;
>      stat_start(display, start_time);
>  
> -    spice_assert(!region_is_empty(&item->base.rgn));
> +    spice_return_val_if_fail(!region_is_empty(&item->base.rgn), FALSE);
>      region_init(&exclude_rgn);
>      now = ring_next(ring, ring);
>  


More information about the Spice-devel mailing list