From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUuH8-0001kS-9s for qemu-devel@nongnu.org; Thu, 27 Aug 2015 06:19:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUuH4-0000zR-NB for qemu-devel@nongnu.org; Thu, 27 Aug 2015 06:19:18 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:35464 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUuH4-0000yP-9F for qemu-devel@nongnu.org; Thu, 27 Aug 2015 06:19:14 -0400 From: Peter Lieven Date: Thu, 27 Aug 2015 12:18:53 +0200 Message-Id: <1440670734-5616-4-git-send-email-pl@kamp.de> In-Reply-To: <1440670734-5616-1-git-send-email-pl@kamp.de> References: <1440670734-5616-1-git-send-email-pl@kamp.de> Subject: [Qemu-devel] [PATCH 3/4] vnc-jobs: move buffer_reset to vnc_async_encoding_end List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Lieven , kraxel@redhat.com now that we are able to shrink the buffer it makes sense to move the buffer_reset to vnc_async_encoding_end to actually shrink the buffer when it is no longer used. Signed-off-by: Peter Lieven --- ui/vnc-jobs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c index 22c9abc..201d9b7 100644 --- a/ui/vnc-jobs.c +++ b/ui/vnc-jobs.c @@ -195,8 +195,6 @@ static void vnc_async_encoding_start(VncState *orig, VncState *local) local->zrle = orig->zrle; local->output = queue->buffer; local->csock = -1; /* Don't do any network work on this thread */ - - buffer_reset(&local->output); } static void vnc_async_encoding_end(VncState *orig, VncState *local) @@ -208,6 +206,7 @@ static void vnc_async_encoding_end(VncState *orig, VncState *local) orig->lossy_rect = local->lossy_rect; queue->buffer = local->output; + buffer_reset(&queue->buffer); } static int vnc_worker_thread_loop(VncJobQueue *queue) -- 1.9.1