[Spice-commits] 2 commits - gtk/channel-display.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Thu Oct 3 07:06:51 PDT 2013


 gtk/channel-display.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit cfd4e8e678b2a65720b5af2060638ffd20c38911
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Thu Oct 3 13:53:36 2013 +0200

    display: cache id is uint64_t

diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index e0f17eb..a57453f 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -551,7 +551,7 @@ static SpicePalette *palette_get(SpicePaletteCache *cache, uint64_t id)
     return cache_find(c->palettes, id);
 }
 
-static void palette_remove(SpicePaletteCache *cache, uint32_t id)
+static void palette_remove(SpicePaletteCache *cache, uint64_t id)
 {
     SpiceDisplayChannelPrivate *c =
         SPICE_CONTAINEROF(cache, SpiceDisplayChannelPrivate, palette_cache);
commit 02c4d61263230e3dbd7900822677c720045b80cf
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Thu Oct 3 13:50:15 2013 +0200

    display: fix palette regression
    
    palette_get() used to return a ref, and palette_release() used to
    release that ref.
    
    Since ed877341, the palette is no longer refcount'ed, since its usage is
    exclusively local in common/canvas code.
    
    palette_release() shouldn't remove the palette from the cache.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1011936

diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index 794f4eb..e0f17eb 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -546,8 +546,8 @@ static SpicePalette *palette_get(SpicePaletteCache *cache, uint64_t id)
         SPICE_CONTAINEROF(cache, SpiceDisplayChannelPrivate, palette_cache);
 
     /* here the returned pointer is weak, no ref given to caller.  it
-     * seems spice canvas usage is exclusively temporary, so it's ok
-     * (for now) */
+     * seems spice canvas usage is exclusively temporary, so it's ok.
+     * palette_release is a noop. */
     return cache_find(c->palettes, id);
 }
 
@@ -561,7 +561,7 @@ static void palette_remove(SpicePaletteCache *cache, uint32_t id)
 
 static void palette_release(SpicePaletteCache *cache, SpicePalette *palette)
 {
-    palette_remove(cache, palette->unique);
+    /* there is no refcount of palette, see palette_get() */
 }
 
 #ifdef SW_CANVAS_CACHE


More information about the Spice-commits mailing list