Avoid core calling spice_server_destroy

spice_server_destroy calls reds_exit which is called also at exit time
(is registered with atexit) so avoid to keep dangling pointers.
Currently this does not happen as spice_server_destroy is not called
by Qemu.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Frediano Ziglio 2015-08-26 15:29:05 +01:00
parent 068bf4e83d
commit 9a62481b83

View File

@ -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
}