[retro-gtk] pixdata: Use g_autofree
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] pixdata: Use g_autofree
- Date: Wed, 14 Aug 2019 11:41:46 +0000 (UTC)
commit d4d978027b4d877306ab9c7f0d1702b00dc4e0c7
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sun Aug 11 23:18:08 2019 +0200
pixdata: Use g_autofree
This simplifies the code.
retro-gtk/retro-pixdata.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/retro-gtk/retro-pixdata.c b/retro-gtk/retro-pixdata.c
index b46c7fa..4f2633b 100644
--- a/retro-gtk/retro-pixdata.c
+++ b/retro-gtk/retro-pixdata.c
@@ -319,8 +319,8 @@ retro_pixdata_to_pixbuf (RetroPixdata *self)
rgba8888 *rgba8888_data;
GdkPixbuf *pixbuf;
gfloat x_dpi;
- gchar *x_dpi_string;
- gchar *y_dpi_string;
+ g_autofree gchar *x_dpi_string = NULL;
+ g_autofree gchar *y_dpi_string = NULL;
g_return_val_if_fail (self != NULL, NULL);
@@ -348,8 +348,6 @@ retro_pixdata_to_pixbuf (RetroPixdata *self)
y_dpi_string = g_strdup_printf ("%g", RETRO_CAIRO_DISPLAY_Y_DPI);
gdk_pixbuf_set_option (pixbuf, "x-dpi", x_dpi_string);
gdk_pixbuf_set_option (pixbuf, "y-dpi", y_dpi_string);
- g_free (y_dpi_string);
- g_free (x_dpi_string);
return pixbuf;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]