[Spice-devel] [PATCH spice-gtk] cairo: fix reference leak

Marc-André Lureau marcandre.lureau at gmail.com
Fri Apr 5 12:45:39 PDT 2013


cairo_surface_finish() doesn't remove the reference,
cairo_surface_destroy() does and will call surface_finish().

Thanks to Uli Schlachter for noticing that in:
https://bugs.freedesktop.org/show_bug.cgi?id=61876
---
 gtk/spice-widget-cairo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtk/spice-widget-cairo.c b/gtk/spice-widget-cairo.c
index bd8e351..e0fe1ed 100644
--- a/gtk/spice-widget-cairo.c
+++ b/gtk/spice-widget-cairo.c
@@ -64,7 +64,7 @@ void spicex_image_destroy(SpiceDisplay *display)
     SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
 
     if (d->ximage) {
-        cairo_surface_finish(d->ximage);
+        cairo_surface_destroy(d->ximage);
         d->ximage = NULL;
     }
     if (d->convert && d->data) {
-- 
1.8.1.1.439.g50a6b54



More information about the Spice-devel mailing list