Re: [PATCH v4 08/14] sound: Implement on_disconnect RedChannel callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 30, 2016 at 12:34:52PM +0000, Frediano Ziglio wrote:
> Avoid having dandling pointer to a client.

'dangling'

> 
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
>  server/sound.c |  9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/server/sound.c b/server/sound.c
> index a5b960b..00eab67 100644
> --- a/server/sound.c
> +++ b/server/sound.c
> @@ -773,6 +773,14 @@ static int snd_channel_config_socket(RedChannelClient *rcc)
>      return TRUE;
>  }
>  
> +static void snd_channel_on_disconnect(RedChannelClient *rcc)
> +{
> +    SndChannel *channel = SND_CHANNEL(red_channel_client_get_channel(rcc));
> +    if (channel->connection && rcc == RED_CHANNEL_CLIENT(channel->connection)) {

Is it expected that channel->connection will sometimes not be equal to rcc here? Or
should it issue some kind of runtime warning if this happens?

> +        channel->connection = NULL;

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]