]> Dogcows Code - chaz/tint2/blobdiff - src/launcher/launcher.c
Fix possible double free in launcher
[chaz/tint2] / src / launcher / launcher.c
index fd85fed0e531fe7e94cfae90b2effa9f94979bdc..ab4ca29d67526e62192b9d40bf87a9b3627577dc 100644 (file)
@@ -34,6 +34,7 @@
 
 int launcher_enabled;
 int launcher_max_icon_size;
+int launcher_tooltip_enabled;
 int launcher_alpha;
 int launcher_saturation;
 int launcher_brightness;
@@ -55,6 +56,7 @@ void default_launcher()
 {
        launcher_enabled = 0;
        launcher_max_icon_size = 0;
+       launcher_tooltip_enabled = 0;
        launcher_alpha = 100;
        launcher_saturation = 0;
        launcher_brightness = 0;
@@ -109,15 +111,11 @@ void cleanup_launcher()
                Panel *panel = &panel1[i];
                Launcher *launcher = &panel->launcher;          
                cleanup_launcher_theme(launcher);
-               
-               GSList *l;
-               for (l = launcher->list_apps; l ; l = l->next) {
-                       free(l->data);
-               }
-               g_slist_free(launcher->list_apps);
-               launcher->list_apps = NULL;
        }
-       g_free(icon_theme_name);
+       g_slist_free_full(panel_config.launcher.list_apps, free);
+       panel_config.launcher.list_apps = NULL;
+       free(icon_theme_name);
+       icon_theme_name = 0;
        launcher_enabled = 0;
 }
 
@@ -694,7 +692,10 @@ void launcher_load_icons(Launcher *launcher)
                        launcherIcon->area.bg = &g_array_index(backgrounds, Background, 0);
                        launcherIcon->area.on_screen = 1;
                        launcherIcon->area._on_change_layout = launcher_icon_on_change_layout;
-                       launcherIcon->area._get_tooltip_text = launcher_icon_get_tooltip_text;
+                       if (launcher_tooltip_enabled) 
+                               launcherIcon->area._get_tooltip_text = launcher_icon_get_tooltip_text;
+                       else
+                               launcherIcon->area._get_tooltip_text = NULL;
                        launcherIcon->is_app_desktop = 1;
                        launcherIcon->cmd = strdup(entry.exec);
                        launcherIcon->icon_name = entry.icon ? strdup(entry.icon) : strdup(ICON_FALLBACK);
This page took 0.026315 seconds and 4 git commands to generate.