From 9aeb9d9fb5e4628ea119f1408f7bd16c96410224 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 8 Jun 2006 10:34:15 +0000 Subject: [PATCH] define vars in proper places and don't leak the entire list of settings --- openbox/config.c | 10 +++++++--- openbox/config.h | 3 ++- openbox/per_app_settings.c | 1 + openbox/per_app_settings.h | 2 -- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/openbox/config.c b/openbox/config.c index 7f51c0f0..78a8ed54 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -80,7 +80,7 @@ gint config_resist_edge; gboolean config_resist_layers_below; -GSList *per_app_settings; +GSList *config_per_app_settings; /* @@ -174,7 +174,7 @@ static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc, setting->layer = 0; } - per_app_settings = g_slist_append(per_app_settings, + config_per_app_settings = g_slist_append(config_per_app_settings, (gpointer) setting); } @@ -728,7 +728,7 @@ void config_startup(ObParseInst *i) parse_register(i, "menu", parse_menu, NULL); - per_app_settings = NULL; + config_per_app_settings = NULL; parse_register(i, "applications", parse_per_app_settings, NULL); } @@ -748,4 +748,8 @@ void config_shutdown() for (it = config_menu_files; it; it = g_slist_next(it)) g_free(it->data); g_slist_free(config_menu_files); + + for (it = config_per_app_settings; it; it = g_slist_next(it)) + g_free(it->data); + g_slist_free(config_per_app_settings); } diff --git a/openbox/config.h b/openbox/config.h index 5abb7d82..29f8d081 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -23,7 +23,6 @@ #include "misc.h" #include "stacking.h" #include "place.h" -#include "per_app_settings.h" #include @@ -129,6 +128,8 @@ extern guint config_submenu_show_delay; extern gboolean config_menu_client_list_icons; /*! User-specified menu files */ extern GSList *config_menu_files; +/*! Per app settings */ +extern GSList *config_per_app_settings; void config_startup(struct _ObParseInst *i); void config_shutdown(); diff --git a/openbox/per_app_settings.c b/openbox/per_app_settings.c index 47b2fc0e..c1b728e2 100644 --- a/openbox/per_app_settings.c +++ b/openbox/per_app_settings.c @@ -18,6 +18,7 @@ #include "per_app_settings.h" #include "screen.h" +#include "config.h" GSList *per_app_settings; diff --git a/openbox/per_app_settings.h b/openbox/per_app_settings.h index b6b7d514..0b1bfca9 100644 --- a/openbox/per_app_settings.h +++ b/openbox/per_app_settings.h @@ -40,8 +40,6 @@ struct _ObAppSetting guint layer; }; -extern GSList *per_app_settings; - ObAppSetting *get_client_settings(ObClient *client); void place_window_from_settings(ObAppSetting *setting, ObClient *client, gint *x, gint *y); -- 2.45.2