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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]