summaryrefslogtreecommitdiffstats
path: root/server/snd_worker.c
diff options
context:
space:
mode:
authorAndrew Eikum <aeikum@codeweavers.com>2012-09-13 13:21:07 -0500
committerChristophe Fergeau <cfergeau@redhat.com>2012-10-01 19:13:10 +0200
commit0a62e332119abf5d21790e125f51c599a5c651dd (patch)
tree791fbb3208d95367b11fcc5d43d69ec2e06ae459 /server/snd_worker.c
parent4114b162ed3c6574174533d5b875d44ade092497 (diff)
downloadspice-0a62e332119abf5d21790e125f51c599a5c651dd.tar.gz
spice-0a62e332119abf5d21790e125f51c599a5c651dd.tar.xz
spice-0a62e332119abf5d21790e125f51c599a5c651dd.zip
server: Don't release SndChannel twice from worker reference
When we release the SndChannel reference during snd_disconnect_channel(), we need to set the pointer to NULL so it doesn't get released again on client reconnect during snd_set_playback_peer(). This can happen when a reference is held from _playback_get_buffer().
Diffstat (limited to 'server/snd_worker.c')
-rw-r--r--server/snd_worker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/snd_worker.c b/server/snd_worker.c
index 995823c4..13f8c4dd 100644
--- a/server/snd_worker.c
+++ b/server/snd_worker.c
@@ -195,7 +195,6 @@ static SndChannel *snd_channel_get(SndChannel *channel)
static SndChannel *snd_channel_put(SndChannel *channel)
{
if (!--channel->refs) {
- channel->worker->connection = NULL;
free(channel);
spice_printerr("sound channel freed");
return NULL;
@@ -223,6 +222,7 @@ static void snd_disconnect_channel(SndChannel *channel)
spice_marshaller_destroy(channel->send_data.marshaller);
}
snd_channel_put(channel);
+ channel->worker->connection = NULL;
}
static void snd_playback_free_frame(PlaybackChannel *playback_channel, AudioFrame *frame)