seoz pushed a commit to branch master.
commit e84e0102e47d5fd41bf9dea8e50bb7f66d1c654e
Author: Daniel Juyung Seo <[email protected]>
Date: Wed May 29 21:00:40 2013 +0900
elm_main.c: ELM_SAFE_FREE adoption.
I splited ELM_SAFE_FREE refactoring patches. One commit per each file as
recommended.
For the detail, please refer 3072dab12f12fe83fb5a628d15efd5cded11787f.
In this commit, I used ELM_SAFE_FREE even inside shutdown function.
---
src/lib/elm_main.c | 26 ++++++--------------------
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/src/lib/elm_main.c b/src/lib/elm_main.c
index 2ed2115..33b5c5b 100644
--- a/src/lib/elm_main.c
+++ b/src/lib/elm_main.c
@@ -312,17 +312,8 @@ elm_shutdown(void)
_elm_clouseau_unload();
// wrningz :(
// _prefix_shutdown();
- if (app_name)
- {
- eina_stringshare_del(app_name);
- app_name = NULL;
- }
-
- if (app_desktop_entry)
- {
- eina_stringshare_del(app_desktop_entry);
- app_desktop_entry = NULL;
- }
+ ELM_SAFE_FREE(app_name, eina_stringshare_del);
+ ELM_SAFE_FREE(app_desktop_entry, eina_stringshare_del);
elm_quicklaunch_sub_shutdown();
elm_quicklaunch_shutdown();
@@ -735,18 +726,13 @@ elm_quicklaunch_shutdown(void)
if (pfx) eina_prefix_free(pfx);
pfx = NULL;
- eina_stringshare_del(_elm_data_dir);
- _elm_data_dir = NULL;
- eina_stringshare_del(_elm_lib_dir);
- _elm_lib_dir = NULL;
-
- free(_elm_appname);
- _elm_appname = NULL;
+ ELM_SAFE_FREE(_elm_data_dir, eina_stringshare_del);
+ ELM_SAFE_FREE(_elm_lib_dir, eina_stringshare_del);
+ ELM_SAFE_FREE(_elm_appname, free);
_elm_config_shutdown();
- ecore_event_handler_del(_elm_exit_handler);
- _elm_exit_handler = NULL;
+ ELM_SAFE_FREE(_elm_exit_handler, ecore_event_handler_del);
_elm_theme_shutdown();
_elm_unneed_systray();
--
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1