changeset 3786:ddfe09d3cf86

fix some memory leaks
author William Pitcock <nenolod@atheme.org>
date Fri, 19 Oct 2007 05:24:27 -0500
parents 48daf98313e0
children bce5ac1f368b
files src/audacious/skin.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/skin.c	Fri Oct 19 04:39:49 2007 -0500
+++ b/src/audacious/skin.c	Fri Oct 19 05:24:27 2007 -0500
@@ -1480,11 +1480,13 @@
     gtk_settings_set_string_property(settings, "gtk-theme-name",
                                      basename(tmp), "audacious");
 
+#if 0
     if (tmp_clean)
     {
         unlink(tmp);
         g_free(tmp);
     }
+#endif
 }
 
 static gboolean
@@ -1528,13 +1530,15 @@
 
         skin_load_cursor(skin, path);
 
-        gtkrcpath = find_file_recursively(skin->path, "gtkrc");
+#ifndef _WIN32
+        gtkrcpath = find_path_recursively(skin->path, "gtkrc");
 
-#ifndef _WIN32
         /* the way GTK does things can be very broken. --nenolod */
         if (gtkrcpath != NULL) {
             skin_set_gtk_theme(settings, skin, FALSE);
         }
+
+        g_free(gtkrcpath);
 #endif
 
         return TRUE;
@@ -1545,8 +1549,6 @@
         return FALSE;
     }
 
-    gtkrcpath = find_file_recursively(skin->path, "gtkrc");
-
     /* Parse the hints for this skin. */
     skin_parse_hints(skin, cpath);
 
@@ -1560,10 +1562,14 @@
     skin_load_cursor(skin, cpath);
 
 #ifndef _WIN32
+    gtkrcpath = find_path_recursively(skin->path, "gtkrc");
+
     /* the way GTK does things can be very broken. --nenolod */
     if (gtkrcpath != NULL) {
         skin_set_gtk_theme(settings, skin, TRUE);
     }
+
+    g_free(gtkrcpath);
 #endif
 
     del_directory(cpath);