[PATCH] Replace gdk_pixbuf_unref with g_object_unref

Darxus at chaosreigns.com Darxus at chaosreigns.com
Tue Jan 25 12:00:56 PST 2011


Because gdk_pixbuf_unref is deprecated and for compatability with
gdk-pixbuf 2.21.4.
---
 clients/window.c           |    8 ++++----
 compositor/compositor.c    |    4 ++--
 compositor/screenshooter.c |    4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index 5f8be17..0278d08 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -291,7 +291,7 @@ display_create_drm_surface_from_file(struct display *display,
 
 	if (!gdk_pixbuf_get_has_alpha(pixbuf) ||
 	    gdk_pixbuf_get_n_channels(pixbuf) != 4) {
-		gdk_pixbuf_unref(pixbuf);
+		g_object_unref(pixbuf);
 		return NULL;
 	}
 
@@ -322,7 +322,7 @@ display_create_drm_surface_from_file(struct display *display,
 			GL_RGBA, GL_UNSIGNED_BYTE, pixels);
 	cairo_device_release(display->device);
 
-	gdk_pixbuf_unref(pixbuf);
+	g_object_unref(pixbuf);
 
 	return surface;
 }
@@ -435,7 +435,7 @@ display_create_shm_surface_from_file(struct display *display,
 
 	if (!gdk_pixbuf_get_has_alpha(pixbuf) ||
 	    gdk_pixbuf_get_n_channels(pixbuf) != 4) {
-		gdk_pixbuf_unref(pixbuf);
+		g_object_unref(pixbuf);
 		return NULL;
 	}
 
@@ -463,7 +463,7 @@ display_create_shm_surface_from_file(struct display *display,
 		}
 	}
 
-	gdk_pixbuf_unref(pixbuf);
+	g_object_unref(pixbuf);
 
 	return surface;
 }
diff --git a/compositor/compositor.c b/compositor/compositor.c
index 27dd50d..d391fca 100644
--- a/compositor/compositor.c
+++ b/compositor/compositor.c
@@ -211,7 +211,7 @@ create_buffer_from_png(struct wlsc_compositor *ec,
 
 	argb_pixels = malloc (height * width * 4);
 	if (argb_pixels == NULL) {
-		gdk_pixbuf_unref(pixbuf);
+		g_object_unref(pixbuf);
 		return NULL;
 	}
 
@@ -250,7 +250,7 @@ create_buffer_from_png(struct wlsc_compositor *ec,
 		}
 	}
 
-	gdk_pixbuf_unref(pixbuf);
+	g_object_unref(pixbuf);
 
 	buffer = ec->create_buffer(ec, width, height,
 				   &ec->compositor.premultiplied_argb_visual,
diff --git a/compositor/screenshooter.c b/compositor/screenshooter.c
index c1716ec..c0757db 100644
--- a/compositor/screenshooter.c
+++ b/compositor/screenshooter.c
@@ -61,8 +61,8 @@ screenshooter_shoot(struct wl_client *client, struct wl_screenshooter *shooter)
 						  NULL, NULL);
 		normal = gdk_pixbuf_flip(pixbuf, FALSE);
 		gdk_pixbuf_save(normal, buffer, "png", &error, NULL);
-		gdk_pixbuf_unref(normal);
-		gdk_pixbuf_unref(pixbuf);
+		g_object_unref(normal);
+		g_object_unref(pixbuf);
 		free(data);
 	}
 }
-- 
1.7.1


More information about the wayland-devel mailing list