Just mark memory as freed after actually freeing it.
authorrfonseca <rfonseca@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 14 Oct 2010 19:19:13 +0000 (19:19 +0000)
committerrfonseca <rfonseca@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 14 Oct 2010 19:19:13 +0000 (19:19 +0000)
Otherwise valgrind would complain about invalid memory access.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@53426 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/mp/chained_pool/eina_chained_mempool.c

index fac12f5..a4e143c 100644 (file)
@@ -246,10 +246,6 @@ eina_chained_mempool_free(void *data, void *ptr)
 #endif
 #endif
 
-#ifndef NVALGRIND
-   VALGRIND_MEMPOOL_FREE(pool, ptr);
-#endif
-
    EINA_INLIST_FOREACH(pool->first, p)
    {
       // Could the pointer be inside that pool
@@ -280,6 +276,10 @@ eina_chained_mempool_free(void *data, void *ptr)
         }
    }
 
+#ifndef NVALGRIND
+   VALGRIND_MEMPOOL_FREE(pool, ptr);
+#endif
+
 #ifdef EFL_HAVE_THREADS
    if (_threads_activated)
      {