[Spice-devel] [PATCH] Avoid core calling spice_server_destroy

Frediano Ziglio fziglio at redhat.com
Wed Aug 26 06:54:14 PDT 2015


> 
> On Fri, Aug 21, 2015 at 10:29:30AM +0100, Frediano Ziglio wrote:
> > spice_server_destroy calls reds_exit which is called also at exit time
> > (is registered with atexit) so avoid to keep dandling pointers.
> 
> s/dandling/dangling/
> 
> Is this possible to trigger somehow? Looks good to me, ACK.
> 
> Christophe
> 

Yes, just call spice_server_destroy and wait for exit() :)

Frediano

> > 
> > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > ---
> >  server/reds.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/server/reds.c b/server/reds.c
> > index c07cb6c..5d2ad9b 100644
> > --- a/server/reds.c
> > +++ b/server/reds.c
> > @@ -2700,8 +2700,11 @@ static void reds_exit(void)
> >          main_channel_close(reds->main_channel);
> >      }
> >  #ifdef RED_STATISTICS
> > -    shm_unlink(reds->stat_shm_name);
> > -    free(reds->stat_shm_name);
> > +    if (reds->stat_shm_name) {
> > +        shm_unlink(reds->stat_shm_name);
> > +        free(reds->stat_shm_name);
> > +        reds->stat_shm_name = NULL;
> > +    }
> >  #endif
> >  }
> >  
> > --
> > 2.4.3
> > 


More information about the Spice-devel mailing list