eina: work around current strange behavior seen in eina_cow.
authorCedric Bail <cedric.bail@samsung.com>
Wed, 4 Dec 2013 06:36:17 +0000 (15:36 +0900)
committerCedric Bail <cedric.bail@samsung.com>
Wed, 4 Dec 2013 06:36:17 +0000 (15:36 +0900)
This is not perfect, it will just limit the propagation of the problem
for some time. Yes, it does hide it under the carpet, but that's better
than having a crash. Problem seems to be in Eina_Hash, but is really
difficult to reproduce and fix for the moment.

src/lib/eina/eina_cow.c

index 73a65e5..2dd8807 100644 (file)
@@ -261,6 +261,16 @@ _eina_cow_gc(Eina_Cow *cow, Eina_Cow_GC *gc)
 
    data = EINA_COW_DATA_GET(gc->ref);
 
+   /*
+     THIS IS A TEMPORARY WORK AROUND THAT SHOULD LIMIT PROBLEM
+     UNTIL WE KNOW WHY THERE IS A PROBLEM IN EINA_HASH.
+   */
+   if (gc->ref->refcount == 0)
+     {
+        eina_hash_del(cow->togc, &gc->ref, gc);
+        return ;
+     }
+
    current_cow_size = cow->struct_size;
    match = eina_hash_find(cow->match, data);
    if (match)