Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_theme.c 


Log Message:
- move the theme hashs over to string references. this fixes an issue where
  the theme data was getting free'd because we're re-hashing the key.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_theme.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- ewl_theme.c 17 Jan 2007 12:52:32 -0000      1.35
+++ ewl_theme.c 18 Jan 2007 11:17:42 -0000      1.36
@@ -75,7 +75,7 @@
        /* Allocate and clear the default theme */
        if (ewl_theme_def_data) ecore_hash_destroy(ewl_theme_def_data);
 
-       ewl_theme_def_data = ecore_hash_new(ecore_str_hash, ecore_str_compare);
+       ewl_theme_def_data = ecore_hash_new(NULL, NULL);
        if (!ewl_theme_def_data)
                DRETURN_INT(FALSE, DLEVEL_STABLE);
 
@@ -255,13 +255,15 @@
 
        if (v != EWL_THEME_KEY_NOMATCH) {
                if (v) {
-                       ecore_hash_set(cache, strdup(k), strdup(v));
+                       ecore_hash_set(cache, (void *)ecore_string_instance(k), 
+                                               (void 
*)ecore_string_instance(v));
                }
                /*
                 * Mark unmatched keys in the cache.
                 */
                else {
-                       ecore_hash_set(cache, strdup(k), EWL_THEME_KEY_NOMATCH);
+                       ecore_hash_set(cache, (void *)ecore_string_instance(k), 
+                                                       EWL_THEME_KEY_NOMATCH);
                }
        }
 
@@ -435,16 +437,18 @@
        DCHECK_PARAM_PTR("k", k);
 
        if (!w->theme || w->theme == ewl_theme_def_data) {
-               w->theme = ecore_hash_new(ecore_str_hash, ecore_str_compare);
+               w->theme = ecore_hash_new(NULL, NULL);
 
                ecore_hash_set_free_key(w->theme, ewl_theme_data_free);
                ecore_hash_set_free_value(w->theme, ewl_theme_data_free);
        }
 
        if (v && v != EWL_THEME_KEY_NOMATCH)
-               ecore_hash_set(w->theme, strdup(k), strdup(v));
+               ecore_hash_set(w->theme, (void *)ecore_string_instance(k), 
+                                               (void 
*)ecore_string_instance(v));
        else
-               ecore_hash_set(w->theme, strdup(k), EWL_THEME_KEY_NOMATCH);
+               ecore_hash_set(w->theme, (void *)ecore_string_instance(k), 
+                                               EWL_THEME_KEY_NOMATCH);
 
        if (REALIZED(w)) {
                ewl_widget_unrealize(w);
@@ -605,7 +609,7 @@
        if (!data || data == (void *)EWL_THEME_KEY_NOMATCH)
                DRETURN(DLEVEL_STABLE);
 
-       FREE(data);
+       ecore_string_release(data);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to