cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=425b39917248b0a64236ac33f0188c8d6c873a6b

commit 425b39917248b0a64236ac33f0188c8d6c873a6b
Author: Cedric BAIL <ced...@efl.so>
Date:   Sun Nov 17 09:11:56 2013 +0100

    eina: remove the value from the hash before changing it !
    
    This should fix bug T439.
---
 src/lib/eina/eina_cow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/eina/eina_cow.c b/src/lib/eina/eina_cow.c
index 0d7dd3a..ca99f5c 100644
--- a/src/lib/eina/eina_cow.c
+++ b/src/lib/eina/eina_cow.c
@@ -430,6 +430,7 @@ eina_cow_free(Eina_Cow *cow, const Eina_Cow_Data **data)
 #endif
    ref->refcount--;
 
+   if (ref->refcount == 0) _eina_cow_hash_del(cow, *data, ref);
    *data = (Eina_Cow_Data*) cow->default_value;
 
    if (ref->refcount > 0)
@@ -443,7 +444,6 @@ eina_cow_free(Eina_Cow *cow, const Eina_Cow_Data **data)
 #ifdef EINA_COW_MAGIC_ON
    EINA_MAGIC_SET(ref, EINA_MAGIC_NONE);
 #endif
-   _eina_cow_hash_del(cow, *data, ref);
    _eina_cow_togc_del(cow, ref);
    eina_mempool_free(cow->pool, (void*) ref);
 }

-- 


Reply via email to