[#3578503]The variable set_wallpaper should be freed after usage.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Sat, 27 Oct 2012 14:05:53 +0000 (17:05 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sat, 27 Oct 2012 14:05:53 +0000 (17:05 +0300)
The variable set_wallpaper is left untouched with some versions of GLib
after parse commandline array therefore pcmanfm will retry to set it again
instead of opening folder. We have to free it after usage and reset to NULL.

src/pcmanfm.c

index 9788086..d62bb5f 100644 (file)
@@ -307,7 +307,7 @@ gboolean pcmanfm_run(gint screen_num)
                 {
                     if(app_config->wallpaper)
                         g_free(app_config->wallpaper);
-                    app_config->wallpaper = g_strdup(set_wallpaper);
+                    app_config->wallpaper = set_wallpaper;
                     if(! wallpaper_mode) /* if wallpaper mode is not specified */
                     {
                         /* do not use solid color mode; otherwise wallpaper won't be shown. */
@@ -316,6 +316,9 @@ gboolean pcmanfm_run(gint screen_num)
                     }
                     wallpaper_changed = TRUE;
                 }
+                else
+                    g_free(set_wallpaper);
+                set_wallpaper = NULL;
             }
 
             if(wallpaper_mode)