summaryrefslogtreecommitdiffstats
path: root/server/spicevmc.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-02-08 10:04:18 +0100
committerHans de Goede <hdegoede@redhat.com>2012-02-20 16:32:31 +0100
commitf3f8ebe91bb95aa340b49a24e5b945a82cefe7c7 (patch)
tree586dee1c614884aeca8602d21d9dd37913eaeb27 /server/spicevmc.c
parent7e3fb815ccdfd7ab42ed8b03958ec00e470e1e8f (diff)
downloadspice-f3f8ebe91bb95aa340b49a24e5b945a82cefe7c7.tar.gz
spice-f3f8ebe91bb95aa340b49a24e5b945a82cefe7c7.tar.xz
spice-f3f8ebe91bb95aa340b49a24e5b945a82cefe7c7.zip
server/spicevmc: Don't destroy the rcc twice
spicevmc calls red_channel_client_destroy() on the rcc when it disconnects since we don't want to delay the destroy until the session gets closed as spicevmc channels can be opened, closed and opened again during a single session. This causes red_channel_client_destroy() to get called twice, triggering an assert, when a connected channel gets destroyed. This was fixed with commit ffc4de01e6f9ea0676f17b10e45a137d7e15d6ac for the case where: a spicevmc channel was open on client disconnected, and the main channel disconnect gets handled first. But the channel can also be destroyed when the chardev gets unregistered with the spice-server. This path still triggers the assert. This patch fixes this by adding a destroying flag to the rcc struct, and also moves the previous fix over to the same, more clean, method of detecting this special case. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'server/spicevmc.c')
-rw-r--r--server/spicevmc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/spicevmc.c b/server/spicevmc.c
index 5cdc513e..30aaf2f4 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -116,9 +116,9 @@ static void spicevmc_red_channel_client_on_disconnect(RedChannelClient *rcc)
sin = state->chardev_sin;
sif = SPICE_CONTAINEROF(sin->base.sif, SpiceCharDeviceInterface, base);
- /* Don't destroy the rcc if the entire client is disconnecting, as then
- red_client_destroy will already do this! */
- if (!rcc->client->disconnecting)
+ /* Don't destroy the rcc if it is already being destroyed, as then
+ red_client_destroy/red_channel_client_destroy will already do this! */
+ if (!rcc->destroying)
red_channel_client_destroy(rcc);
state->rcc = NULL;