[Goodies-commits] r5744 - ristretto/trunk/src

Stephan Arts stephan at xfce.org
Wed Oct 22 07:42:19 CEST 2008


Author: stephan
Date: 2008-10-22 05:42:19 +0000 (Wed, 22 Oct 2008)
New Revision: 5744

Modified:
   ristretto/trunk/src/main_window.c
   ristretto/trunk/src/navigator.c
Log:
Plug memory leak (I think) and fix compile-warning



Modified: ristretto/trunk/src/main_window.c
===================================================================
--- ristretto/trunk/src/main_window.c	2008-10-21 23:07:51 UTC (rev 5743)
+++ ristretto/trunk/src/main_window.c	2008-10-22 05:42:19 UTC (rev 5744)
@@ -438,7 +438,6 @@
 
         g_snprintf(selection_name, 100, XFDESKTOP_SELECTION_FMT, xscreen);
 
-        Window root_window = GDK_ROOT_WINDOW();
         Atom xfce_selection_atom = XInternAtom (gdk_display, selection_name, False);
         if((XGetSelectionOwner(GDK_DISPLAY(), xfce_selection_atom)))
         {
@@ -1215,6 +1214,7 @@
                 }
                 g_free(image_path_prop);
                 g_free(image_show_prop);
+                g_free(image_style_prop);
                 g_object_unref(xfdesktop_channel);
             }
             break;

Modified: ristretto/trunk/src/navigator.c
===================================================================
--- ristretto/trunk/src/navigator.c	2008-10-21 23:07:51 UTC (rev 5743)
+++ ristretto/trunk/src/navigator.c	2008-10-22 05:42:19 UTC (rev 5744)
@@ -1156,6 +1156,11 @@
     }
     if ((entry->loader == NULL) && ((empty_cache == TRUE ) || entry->src_pixbuf == NULL))
     {
+        if (entry->src_pixbuf)
+        {
+            gdk_pixbuf_unref(entry->src_pixbuf);
+            entry->src_pixbuf = NULL;
+        }
         entry->loader = gdk_pixbuf_loader_new();
 
         g_signal_connect(entry->loader, "area-prepared", G_CALLBACK(cb_rstto_navigator_entry_area_prepared), entry);
@@ -1272,14 +1277,14 @@
 static void
 cb_rstto_navigator_entry_closed (GdkPixbufLoader *loader, RsttoNavigatorEntry *entry)
 {
+    GdkPixbuf *pixbuf = NULL;
+
     if (entry->src_pixbuf)
     {
         gdk_pixbuf_unref(entry->src_pixbuf);
         entry->src_pixbuf = NULL;
     }
 
-    GdkPixbuf *pixbuf = NULL;
-
     if (entry->iter)
     {
         pixbuf = gdk_pixbuf_animation_iter_get_pixbuf(entry->iter);
@@ -1302,11 +1307,14 @@
     if (pixbuf != NULL)
     {
         entry->src_pixbuf = gdk_pixbuf_rotate_simple(pixbuf, rstto_navigator_entry_get_rotation(entry));
+        gdk_pixbuf_unref(pixbuf);
+        pixbuf = NULL;
         if (rstto_navigator_entry_get_flip(entry, FALSE))
         {
             pixbuf = entry->src_pixbuf;
             entry->src_pixbuf = gdk_pixbuf_flip(pixbuf, FALSE);
             gdk_pixbuf_unref(pixbuf);
+            pixbuf = NULL;
         }
 
         if (rstto_navigator_entry_get_flip(entry, TRUE))
@@ -1314,6 +1322,7 @@
             pixbuf = entry->src_pixbuf;
             entry->src_pixbuf = gdk_pixbuf_flip(pixbuf, TRUE);
             gdk_pixbuf_unref(pixbuf);
+            pixbuf = NULL;
         }
         g_signal_emit(G_OBJECT(entry->navigator), rstto_navigator_signals[RSTTO_NAVIGATOR_SIGNAL_ENTRY_MODIFIED], 0, entry, NULL);
     }




More information about the Goodies-commits mailing list