From 48d18c7535ca7e9203ee89d01b0ed6863c00993d Mon Sep 17 00:00:00 2001 From: stffrdhrn Date: Tue, 21 Feb 2006 15:00:10 +0000 Subject: [PATCH] Few stale memory plugs and cleanups: * Free the e_app callback for e_border on shutdown * Free the prefix strings on shutdown * Make better intl errors * Worthless function commenting * Comment for disabled shutdown unroll (Why is it disabled?) SVN revision: 20689 --- src/bin/e_apps.c | 12 ++++++++++++ src/bin/e_border.c | 3 +++ src/bin/e_intl.c | 13 ++++++++----- src/bin/e_main.c | 6 +++++- src/bin/e_prefix.c | 15 ++++++++------- src/bin/e_prefix.h | 1 + 6 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/bin/e_apps.c b/src/bin/e_apps.c index 4e570fb2e..a5025d9b0 100644 --- a/src/bin/e_apps.c +++ b/src/bin/e_apps.c @@ -678,6 +678,18 @@ e_app_change_callback_add(void (*func) (void *data, E_App *a, E_App_Change ch), _e_apps_change_callbacks = evas_list_append(_e_apps_change_callbacks, cb); } +/* + * Delete the registered callback which has been registered with the data + * given data pointer. This function will return after the first match is + * made. + * + * This will only delete the internal callback function reference. It will + * not delete the data. If the data or callback pointers can not be matched + * this function does nothing. + * + * @func pointer to function to be deleted + * @data pointer that was initialy registered with the add function + */ EAPI void e_app_change_callback_del(void (*func) (void *data, E_App *a, E_App_Change ch), void *data) { diff --git a/src/bin/e_border.c b/src/bin/e_border.c index e7b3e5f0e..7c37a9ef0 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -192,6 +192,9 @@ e_border_shutdown(void) handlers = evas_list_remove_list(handlers, handlers); ecore_event_handler_del(h); } + + e_app_change_callback_del(_e_border_app_change, NULL); + return 1; } diff --git a/src/bin/e_intl.c b/src/bin/e_intl.c index 8b5d6b6b3..919df3456 100644 --- a/src/bin/e_intl.c +++ b/src/bin/e_intl.c @@ -209,9 +209,9 @@ e_intl_language_set(const char *lang) alias_locale = _e_intl_locale_alias_get(_e_intl_language); if (!_e_intl_locale_validate(alias_locale)) { - fprintf(stderr, "Locale %s is NO GOOD. Please " - "install this locale or don't " - "use it!\n", alias_locale); + fprintf(stderr, "The locale %s cannot be found on your " + "system. Please install this locale or try " + "something else.\n", alias_locale); } else { @@ -224,11 +224,14 @@ e_intl_language_set(const char *lang) if (locale_path == NULL) { fprintf(stderr, "Can't find the " - "translation for your locale(%s). " + "translation path for the locale %s. " "Please make sure your messages " "path is in order. If this locale " "is an alias make sure you have your " - "locale.aliases file in the right place\n", alias_locale); + "locale.aliases file in the right place. Note: " + "If your locale is C, POSIX, en_US, en_GB, " + "en_US.utf8 etc. this is normal.\n", + alias_locale); } else { diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 6604673c9..8e6a682b0 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -685,7 +685,9 @@ main(int argc, char **argv) /* Store current selected desktops */ _e_main_desk_save(); -#if 0 + + /* FIXME: why? oh why is this disabled? */ +#if 0 /* unroll our stack of shutdown functions with exit code of 0 */ _e_main_shutdown(0); @@ -701,6 +703,8 @@ main(int argc, char **argv) ecore_file_shutdown(); ecore_app_restart(); } + + e_prefix_shutdown(); /* just return 0 to keep the compiler quiet */ return 0; diff --git a/src/bin/e_prefix.c b/src/bin/e_prefix.c index e991e9c4f..94046d3b6 100644 --- a/src/bin/e_prefix.c +++ b/src/bin/e_prefix.c @@ -22,12 +22,7 @@ e_prefix_determine(char *argv0) { char *p; - E_FREE(_exe_path); - E_FREE(_prefix_path); - E_FREE(_prefix_path_locale); - E_FREE(_prefix_path_bin); - E_FREE(_prefix_path_data); - E_FREE(_prefix_path_lib); + e_prefix_shutdown(); if (!_e_prefix_try_proc()) { @@ -102,7 +97,7 @@ e_prefix_determine(char *argv0) } EAPI void -e_prefix_fallback(void) +e_prefix_shutdown(void) { E_FREE(_exe_path); E_FREE(_prefix_path); @@ -110,6 +105,12 @@ e_prefix_fallback(void) E_FREE(_prefix_path_bin); E_FREE(_prefix_path_data); E_FREE(_prefix_path_lib); +} + +EAPI void +e_prefix_fallback(void) +{ + e_prefix_shutdown(); _e_prefix_fallbacks(); } diff --git a/src/bin/e_prefix.h b/src/bin/e_prefix.h index 3455994af..cccdef4c2 100644 --- a/src/bin/e_prefix.h +++ b/src/bin/e_prefix.h @@ -8,6 +8,7 @@ #define E_PREFIX_H EAPI int e_prefix_determine(char *argv0); +EAPI void e_prefix_shutdown(void); EAPI void e_prefix_fallback(void); EAPI const char *e_prefix_get(void); EAPI const char *e_prefix_locale_get(void);