[Spice-devel] [spice-gtk 1/2] Rename display_cache::cache_unref to cache_free
Christophe Fergeau
cfergeau at redhat.com
Mon Oct 12 07:38:21 PDT 2015
display_cache is no longer refcounted since commit c9d4773, but this is
not an issue as even before, the fact that it was refcounted was not
used as there was no corresponding cache_ref() call (and
g_hash_table_ref() was not called directly either).
As the next commit will free memory from cache_unref() rather than just
releasing a reference, it's better to make it obvious that this method
is a _free() method rather than an _unref() one.
---
src/channel-cursor.c | 2 +-
src/channel-display.c | 2 +-
src/spice-channel-cache.h | 2 +-
src/spice-session.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/channel-cursor.c b/src/channel-cursor.c
index e6514a2..08758c8 100644
--- a/src/channel-cursor.c
+++ b/src/channel-cursor.c
@@ -91,7 +91,7 @@ static void spice_cursor_channel_finalize(GObject *obj)
SpiceCursorChannel *channel = SPICE_CURSOR_CHANNEL(obj);
SpiceCursorChannelPrivate *c = channel->priv;
- g_clear_pointer(&c->cursors, cache_unref);
+ g_clear_pointer(&c->cursors, cache_free);
if (G_OBJECT_CLASS(spice_cursor_channel_parent_class)->finalize)
G_OBJECT_CLASS(spice_cursor_channel_parent_class)->finalize(obj);
diff --git a/src/channel-display.c b/src/channel-display.c
index c3a504f..945309a 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -142,7 +142,7 @@ static void spice_display_channel_finalize(GObject *object)
clear_surfaces(SPICE_CHANNEL(object), FALSE);
g_hash_table_unref(c->surfaces);
clear_streams(SPICE_CHANNEL(object));
- g_clear_pointer(&c->palettes, cache_unref);
+ g_clear_pointer(&c->palettes, cache_free);
if (G_OBJECT_CLASS(spice_display_channel_parent_class)->finalize)
G_OBJECT_CLASS(spice_display_channel_parent_class)->finalize(object);
diff --git a/src/spice-channel-cache.h b/src/spice-channel-cache.h
index 6e2d084..238ceb7 100644
--- a/src/spice-channel-cache.h
+++ b/src/spice-channel-cache.h
@@ -128,7 +128,7 @@ static inline void cache_clear(display_cache *cache)
g_hash_table_remove_all(cache->table);
}
-static inline void cache_unref(display_cache *cache)
+static inline void cache_free(display_cache *cache)
{
g_hash_table_unref(cache->table);
}
diff --git a/src/spice-session.c b/src/spice-session.c
index e1d9997..7a700c5 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -372,7 +372,7 @@ spice_session_finalize(GObject *gobject)
g_strfreev(s->secure_channels);
g_free(s->shared_dir);
- g_clear_pointer(&s->images, cache_unref);
+ g_clear_pointer(&s->images, cache_free);
glz_decoder_window_destroy(s->glz_window);
g_clear_pointer(&s->pubkey, g_byte_array_unref);
--
2.5.0
More information about the Spice-devel
mailing list