[Spice-devel] [PATCH 22/30] Encapsulate dcc_release_glz

Frediano Ziglio fziglio at redhat.com
Tue Jun 7 10:18:00 UTC 2016


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

diff --git a/server/dcc-encoders.c b/server/dcc-encoders.c
index 6b6b95b..899e549 100644
--- a/server/dcc-encoders.c
+++ b/server/dcc-encoders.c
@@ -64,6 +64,7 @@ static void dcc_free_glz_drawable_instance(EncodersData *enc,
                                            GlzDrawableInstanceItem *item);
 static void encoder_data_init(EncoderData *data);
 static void encoder_data_reset(EncoderData *data);
+static void dcc_release_glz(EncodersData *enc);
 
 
 static SPICE_GNUC_NORETURN SPICE_GNUC_PRINTF(2, 3) void
@@ -456,6 +457,7 @@ void dcc_encoders_init(EncodersData *enc)
 
 void dcc_encoders_free(EncodersData *enc)
 {
+    dcc_release_glz(enc);
     quic_destroy(enc->quic);
     enc->quic = NULL;
     lz_destroy(enc->lz);
@@ -759,7 +761,7 @@ gboolean dcc_glz_encoder_create(EncodersData *enc, uint8_t id)
 }
 
 /* destroy encoder, and dictionary if no one uses it*/
-void dcc_release_glz(EncodersData *enc)
+static void dcc_release_glz(EncodersData *enc)
 {
     GlzSharedDictionary *shared_dict;
 
diff --git a/server/dcc-encoders.h b/server/dcc-encoders.h
index d104b4d..08f9826 100644
--- a/server/dcc-encoders.h
+++ b/server/dcc-encoders.h
@@ -41,7 +41,6 @@ int dcc_free_some_independent_glz_drawables(EncodersData *enc, int release_count
 void dcc_free_glz_drawables(EncodersData *enc);
 void dcc_free_glz_drawables_to_free(EncodersData* enc);
 gboolean dcc_glz_encoder_create(EncodersData *enc, uint8_t id);
-void dcc_release_glz(EncodersData *enc);
 void dcc_glz_free_from_drawable(struct Drawable *drawable);
 void dcc_glz_detach_from_drawable(struct Drawable *drawable);
 void dcc_glz_get_restore_data(EncodersData *enc,
diff --git a/server/dcc.c b/server/dcc.c
index 5447adb..f5749c0 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -489,7 +489,6 @@ void dcc_stop(DisplayChannelClient *dcc)
 
     pixmap_cache_unref(dcc->pixmap_cache);
     dcc->pixmap_cache = NULL;
-    dcc_release_glz(&dcc->encoders);
     dcc_palette_cache_reset(dcc);
     free(dcc->send_data.stream_outbuf);
     free(dcc->send_data.free_list.res);
-- 
2.7.4



More information about the Spice-devel mailing list