seoz pushed a commit to branch master.
commit 127817c5eee8e0701c0f888dd7a73bc05bbac300
Author: Daniel Juyung Seo <[email protected]>
Date: Wed May 29 21:08:05 2013 +0900
elm_theme.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.
---
src/lib/elm_theme.c | 25 +++++--------------------
1 file changed, 5 insertions(+), 20 deletions(-)
diff --git a/src/lib/elm_theme.c b/src/lib/elm_theme.c
index 40646e6..0dcb765 100644
--- a/src/lib/elm_theme.c
+++ b/src/lib/elm_theme.c
@@ -23,21 +23,10 @@ _elm_theme_clear(Elm_Theme *th)
eina_stringshare_del(p);
EINA_LIST_FREE(th->extension, p)
eina_stringshare_del(p);
- if (th->cache)
- {
- eina_hash_free(th->cache);
- th->cache = NULL;
- }
- if (th->cache_data)
- {
- eina_hash_free(th->cache_data);
- th->cache_data = NULL;
- }
- if (th->theme)
- {
- eina_stringshare_del(th->theme);
- th->theme = NULL;
- }
+
+ ELM_SAFE_FREE(th->cache, eina_hash_free);
+ ELM_SAFE_FREE(th->cache_data, eina_hash_free);
+ ELM_SAFE_FREE(th->theme, eina_stringshare_del);
if (th->ref_theme)
{
th->ref_theme->referrers =
@@ -555,11 +544,7 @@ elm_theme_set(Elm_Theme *th, const char *theme)
{
if (!th) th = &(theme_default);
_elm_theme_parse(th, theme);
- if (th->theme)
- {
- eina_stringshare_del(th->theme);
- th->theme = NULL;
- }
+ ELM_SAFE_FREE(th->theme, eina_stringshare_del);
elm_theme_flush(th);
if (th == &(theme_default))
eina_stringshare_replace(&_elm_config->theme, theme);
--
------------------------------------------------------------------------------
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