Hack to avoid freeing old data when calling eina_hash_set() with new_data == NULL...
authorsachiel <sachiel>
Thu, 29 Mar 2012 17:46:17 +0000 (17:46 +0000)
committersachiel <sachiel@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 29 Mar 2012 17:46:17 +0000 (17:46 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@69763 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
src/lib/eina_hash.c

index 354500d..e6b59b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2012-03-16  Raphael Kubo da Costa
 
        * Adjust Valgrind's CFLAGS to fix the build when it is in a non-default location.
+
+2012-03-29 Iván Briano
+
+       * Avoid freeing old data before returning it on eina_hash_set().
index 5196894..afdc114 100644 (file)
@@ -1136,7 +1136,10 @@ eina_hash_set(Eina_Hash *hash, const void *key, const void *data)
          }
        else
          {
+            Eina_Free_Cb cb = hash->data_free_cb;
+            hash->data_free_cb = NULL;
            _eina_hash_del_by_hash_el(hash, hash_element, hash_head, key_hash);
+            hash->data_free_cb = cb;
          }
 
         return old_data;