server/red_channel: fix segfault on red_channel_destroy if peer already removed

This commit is contained in:
Alon Levy 2011-01-15 20:53:44 +02:00
parent b6445d35f7
commit fcd4a8e446

View File

@ -312,7 +312,7 @@ void red_channel_destroy(RedChannel *channel)
void red_channel_shutdown(RedChannel *channel)
{
red_printf("");
if (!channel->peer->shutdown) {
if (channel->peer && !channel->peer->shutdown) {
channel->core->watch_update_mask(channel->peer->watch,
SPICE_WATCH_EVENT_READ);
red_channel_pipe_clear(channel);