efl/cserve2: Fix invalid iteration over client references

The _request_failed() function is called by error responses from slaves,
and iterating over references of a entry and removing each of them must
be done with EINA_LIST_FOREACH_SAFE(), since _entry_free_cb() calls
_entry_reference_del() which then removes the reference that is used in
the next iteration in for-loop from _request_failed().

Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi>


SVN revision: 81580
This commit is contained in:
Paulo Alcantara 2012-12-21 21:09:45 +00:00 committed by Leandro Pereira
parent 5973f890aa
commit da061849b0
1 changed files with 2 additions and 2 deletions

View File

@ -388,12 +388,12 @@ _open_request_response(File_Data *e, Slave_Msg_Image_Opened *resp, int *size)
static void static void
_request_failed(Entry *e, Error_Type type EINA_UNUSED) _request_failed(Entry *e, Error_Type type EINA_UNUSED)
{ {
Eina_List *l; Eina_List *l, *l_next;
Reference *ref; Reference *ref;
e->request = NULL; e->request = NULL;
EINA_LIST_FOREACH(e->references, l, ref) EINA_LIST_FOREACH_SAFE(e->references, l, l_next, ref)
{ {
Eina_Hash *hash = NULL; Eina_Hash *hash = NULL;
if (e->type == CSERVE2_IMAGE_FILE) if (e->type == CSERVE2_IMAGE_FILE)