[Xfce4-commits] <midori:master> Free up resources of encoded thumbnails

Christian Dywan noreply at xfce.org
Sun Apr 3 22:36:02 CEST 2011


Updating branch refs/heads/master
         to 599bd748df5419ffb0412b499a2add70ab037ad8 (commit)
       from 4cc6ec5b6789005d32923ee38e775a2c66d9bfa4 (commit)

commit 599bd748df5419ffb0412b499a2add70ab037ad8
Author: Paweł Forysiuk <tuxator at o2.pl>
Date:   Thu Mar 24 10:55:12 2011 +0100

    Free up resources of encoded thumbnails

 midori/midori-view.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index f361287..195b1d8 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -3819,22 +3819,22 @@ prepare_speed_dial_html (MidoriView* view)
             gchar* thumb_file = sokoke_build_thumbnail_path (slot_id);
             gchar* uri = g_key_file_get_string (key_file, dial_entry, "uri", NULL);
             gchar* title = g_key_file_get_string (key_file, dial_entry, "title", NULL);
-            gsize sz;
             gchar* encoded;
-            gchar* thumb_content;
 
             if (g_access (thumb_file, F_OK) == 0)
             {
+                gsize sz;
+                gchar* thumb_content;
                 g_file_get_contents (thumb_file, &thumb_content, &sz, NULL);
                 encoded = g_base64_encode ((guchar*)thumb_content, sz);
-                g_free (thumb_file);
                 g_free (thumb_content);
             }
             else
             {
-                encoded = "";
+                encoded = g_strdup ("");
             }
             g_free (slot_id);
+            g_free (thumb_file);
 
             g_string_append_printf (markup,
                     "<div class=\"shortcut%s activated\" id=\"s%d\">\n"
@@ -3847,6 +3847,7 @@ prepare_speed_dial_html (MidoriView* view)
 
             g_free (uri);
             g_free (title);
+            g_free (encoded);
         }
         else
         {



More information about the Xfce4-commits mailing list