execp: Fix segfault

This commit is contained in:
o9000 2015-12-09 22:14:54 +01:00
parent c125e73402
commit b1374f0cb8

View file

@ -109,12 +109,17 @@ void init_execp()
} }
if (to_remove) { if (to_remove) {
// Cut panel_config.execp_list if (to_remove == panel_config.execp_list) {
if (to_remove->prev) g_list_free_full(to_remove, destroy_execp);
to_remove->prev->next = NULL; panel_config.execp_list = NULL;
to_remove->prev = NULL; } else {
// Remove all elements of to_remove and to_remove itself // Cut panel_config.execp_list
g_list_free_full(to_remove, destroy_execp); if (to_remove->prev)
to_remove->prev->next = NULL;
to_remove->prev = NULL;
// Remove all elements of to_remove and to_remove itself
g_list_free_full(to_remove, destroy_execp);
}
} }
for (GList *l = panel_config.execp_list; l; l = l->next) { for (GList *l = panel_config.execp_list; l; l = l->next) {