[Spice-devel] [PATCH spice-server v3 3/4] spicevmc: More RedVmcChannel::recv_from_client_buf cleanup to finalize

Frediano Ziglio fziglio at redhat.com
Thu Nov 3 16:33:36 UTC 2016


No reason why this should be done only on spicevmc_device_disconnect.
red_char_device_write_buffer_release can be called with first pointer
NULL.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/spicevmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/spicevmc.c b/server/spicevmc.c
index 1eadbbb..b643787 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -256,6 +256,7 @@ red_vmc_channel_finalize(GObject *object)
 {
     RedVmcChannel *self = RED_VMC_CHANNEL(object);
 
+    red_char_device_write_buffer_release(self->chardev, &self->recv_from_client_buf);
     if (self->pipe_item) {
         red_pipe_item_unref(&self->pipe_item->base);
     }
@@ -884,7 +885,6 @@ void spicevmc_device_disconnect(RedsState *reds, SpiceCharDeviceInstance *sin)
     channel = vmc->channel;
     vmc->channel = NULL;
 
-    red_char_device_write_buffer_release(channel->chardev, &channel->recv_from_client_buf);
     /* FIXME */
     red_char_device_destroy(RED_CHAR_DEVICE(vmc));
     channel->chardev = NULL;
-- 
2.7.4



More information about the Spice-devel mailing list