[gtk+] Plug two memory leak



commit b12d7dfcd61376ef110ca996b21ed2115ec635c4
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jan 20 23:09:59 2013 -0500

    Plug two memory leak
    
    g_resources_lookup_data returns a GBytes that must be unreffed.

 demos/gtk-demo/css_pixbufs.c |    1 +
 demos/gtk-demo/css_shadows.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/demos/gtk-demo/css_pixbufs.c b/demos/gtk-demo/css_pixbufs.c
index c2b32b5..4f788a8 100644
--- a/demos/gtk-demo/css_pixbufs.c
+++ b/demos/gtk-demo/css_pixbufs.c
@@ -106,6 +106,7 @@ do_css_pixbufs (GtkWidget *do_widget)
 
       bytes = g_resources_lookup_data ("/css_pixbufs/gtk.css", 0, NULL);
       gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
+      g_bytes_unref (bytes);
 
       g_signal_connect (provider,
                         "parsing-error",
diff --git a/demos/gtk-demo/css_shadows.c b/demos/gtk-demo/css_shadows.c
index 382d558..2ee2fec 100644
--- a/demos/gtk-demo/css_shadows.c
+++ b/demos/gtk-demo/css_shadows.c
@@ -126,6 +126,7 @@ do_css_shadows (GtkWidget *do_widget)
 
       bytes = g_resources_lookup_data ("/css_shadows/gtk.css", 0, NULL);
       gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
+      g_bytes_unref (bytes);
 
       g_signal_connect (provider,
                         "parsing-error",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]