[retro-gtk/pixbuf-aspect-ratio: 1/2] pixdata: Use g_autofree



commit a3afc8d46bd8531a461869d906d715eb3a26c907
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..eee70e5 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;
+  g_autofree gchar *y_dpi_string;
 
   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]