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

Frediano Ziglio fziglio at redhat.com
Tue Jun 7 10:17:52 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 a6e7b2c..e606ded 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 dcc_encoders_free(EncodersData *enc)
 {
-    EncodersData *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 f1c4edf..b9c81e8 100644
--- a/server/dcc-encoders.h
+++ b/server/dcc-encoders.h
@@ -37,7 +37,7 @@ typedef struct RedGlzDrawable RedGlzDrawable;
 typedef struct EncodersData EncodersData;
 
 void             dcc_encoders_init                           (DisplayChannelClient *dcc);
-void             dcc_encoders_free                           (DisplayChannelClient *dcc);
+void dcc_encoders_free(EncodersData *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 46182f9..40a465e 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);
+    dcc_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