[Spice-devel] [PATCH v2 14/30] More encapsulation for dcc_encoders_free

Frediano Ziglio fziglio at redhat.com
Thu Jun 9 12:31:34 UTC 2016


Encoders function should not use DisplayChannelClient

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/dcc-encoders.c | 3 +--
 server/dcc-encoders.h | 2 +-
 server/dcc.c          | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/server/dcc-encoders.c b/server/dcc-encoders.c
index 04bb60c..6aaf954 100644
--- a/server/dcc-encoders.c
+++ b/server/dcc-encoders.c
@@ -415,9 +415,8 @@ void dcc_encoders_init(DisplayChannelClient *dcc)
     enc->zlib_level = ZLIB_DEFAULT_COMPRESSION_LEVEL;
 }
 
-void dcc_encoders_free(DisplayChannelClient *dcc)
+void image_encoders_free(ImageEncoders *enc)
 {
-    ImageEncoders *enc = &dcc->encoders;
     quic_destroy(enc->quic);
     enc->quic = NULL;
     lz_destroy(enc->lz);
diff --git a/server/dcc-encoders.h b/server/dcc-encoders.h
index 092e213..eb33458 100644
--- a/server/dcc-encoders.h
+++ b/server/dcc-encoders.h
@@ -37,7 +37,7 @@ typedef struct RedGlzDrawable RedGlzDrawable;
 typedef struct ImageEncoders ImageEncoders;
 
 void             dcc_encoders_init                           (DisplayChannelClient *dcc);
-void             dcc_encoders_free                           (DisplayChannelClient *dcc);
+void image_encoders_free(ImageEncoders *enc);
 void             dcc_free_glz_drawable                       (DisplayChannelClient *dcc,
                                                               RedGlzDrawable *drawable);
 int              dcc_free_some_independent_glz_drawables     (DisplayChannelClient *dcc);
diff --git a/server/dcc.c b/server/dcc.c
index ee21bb1..7724e11 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -499,7 +499,7 @@ void dcc_stop(DisplayChannelClient *dcc)
     free(dcc->send_data.stream_outbuf);
     free(dcc->send_data.free_list.res);
     dcc_destroy_stream_agents(dcc);
-    dcc_encoders_free(dcc);
+    image_encoders_free(&dcc->encoders);
 
     if (dcc->gl_draw_ongoing) {
         display_channel_gl_draw_done(dc);
-- 
2.7.4



More information about the Spice-devel mailing list