diff mbox

[3/4] vnc-jobs: move buffer_reset to vnc_async_encoding_end

Message ID 1440670734-5616-4-git-send-email-pl@kamp.de
State New
Headers show

Commit Message

Peter Lieven Aug. 27, 2015, 10:18 a.m. UTC
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 <pl@kamp.de>
---
 ui/vnc-jobs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox

Patch

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)