multiple flush may happen when handling errors. May be used in some cases.
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@67839
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
_eina_value_type_stringshare_flush(const Eina_Value_Type *type __UNUSED__, void *mem)
{
const char **tmem = mem;
- if (*tmem) eina_stringshare_del(*tmem);
+ if (*tmem)
+ {
+ eina_stringshare_del(*tmem);
+ *tmem = NULL;
+ }
return EINA_TRUE;
}
_eina_value_type_string_flush(const Eina_Value_Type *type __UNUSED__, void *mem)
{
char **tmem = mem;
- if (*tmem) free(*tmem);
+ if (*tmem)
+ {
+ free(*tmem);
+ *tmem = NULL;
+ }
return EINA_TRUE;
}
Eina_Value_Blob *tmem = mem;
if ((ops) && (ops->free))
ops->free(ops, (void *)tmem->memory, tmem->size);
+ tmem->memory = NULL;
+ tmem->size = 0;
return EINA_TRUE;
}
else
free(tmem->memory);
+ tmem->memory = NULL;
+ tmem->desc = NULL;
+
return ret;
}