Fixed multiple memory leaks
This commit is contained in:
@@ -59,6 +59,9 @@ void destroy_execp(void *obj)
|
|||||||
// This is a frontend element
|
// This is a frontend element
|
||||||
execp->backend->instances = g_list_remove_all(execp->backend->instances, execp);
|
execp->backend->instances = g_list_remove_all(execp->backend->instances, execp);
|
||||||
free_and_null(execp->frontend);
|
free_and_null(execp->frontend);
|
||||||
|
remove_area(&execp->area);
|
||||||
|
free_area(&execp->area);
|
||||||
|
free_and_null(execp);
|
||||||
} else {
|
} else {
|
||||||
// This is a backend element
|
// This is a backend element
|
||||||
stop_timeout(execp->backend->timer);
|
stop_timeout(execp->backend->timer);
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ void free_themes(IconThemeWrapper *wrapper)
|
|||||||
{
|
{
|
||||||
if (!wrapper)
|
if (!wrapper)
|
||||||
return;
|
return;
|
||||||
|
free(wrapper->icon_theme_name);
|
||||||
for (GSList *l = wrapper->themes; l; l = l->next) {
|
for (GSList *l = wrapper->themes; l; l = l->next) {
|
||||||
IconTheme *theme = (IconTheme *)l->data;
|
IconTheme *theme = (IconTheme *)l->data;
|
||||||
free_icon_theme(theme);
|
free_icon_theme(theme);
|
||||||
|
|||||||
@@ -452,7 +452,11 @@ void launcher_reload_icon(Launcher *launcher, LauncherIcon *launcherIcon)
|
|||||||
DesktopEntry entry;
|
DesktopEntry entry;
|
||||||
if (read_desktop_file(launcherIcon->config_path, &entry) && entry.exec) {
|
if (read_desktop_file(launcherIcon->config_path, &entry) && entry.exec) {
|
||||||
schedule_redraw(&launcherIcon->area);
|
schedule_redraw(&launcherIcon->area);
|
||||||
|
if (launcherIcon->cmd)
|
||||||
|
free(launcherIcon->cmd);
|
||||||
launcherIcon->cmd = strdup(entry.exec);
|
launcherIcon->cmd = strdup(entry.exec);
|
||||||
|
if (launcherIcon->icon_name)
|
||||||
|
free(launcherIcon->icon_name);
|
||||||
launcherIcon->icon_name = entry.icon ? strdup(entry.icon) : strdup(DEFAULT_ICON);
|
launcherIcon->icon_name = entry.icon ? strdup(entry.icon) : strdup(DEFAULT_ICON);
|
||||||
if (entry.name) {
|
if (entry.name) {
|
||||||
if (entry.generic_name) {
|
if (entry.generic_name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user