Eina: unlock mutex before returning

Patch by Shinwoo Kim, modified by me

SVN revision: 68885
This commit is contained in:
Vincent Torri 2012-03-07 07:25:05 +00:00
parent ba9617888d
commit 9bddd8c4a7
1 changed files with 7 additions and 2 deletions

View File

@ -1079,7 +1079,11 @@ eina_file_map_new(Eina_File *file, Eina_File_Populate rule,
void *data; void *data;
map = malloc(sizeof (Eina_File_Map)); map = malloc(sizeof (Eina_File_Map));
if (!map) return NULL; if (!map)
{
eina_lock_release(&file->lock);
return NULL;
}
data = MapViewOfFile(file->fm, FILE_MAP_READ, data = MapViewOfFile(file->fm, FILE_MAP_READ,
offset & 0xffff0000, offset & 0xffff0000,
@ -1097,6 +1101,7 @@ eina_file_map_new(Eina_File *file, Eina_File_Populate rule,
if (map->map == MAP_FAILED) if (map->map == MAP_FAILED)
{ {
free(map); free(map);
eina_lock_release(&file->lock);
return NULL; return NULL;
} }
@ -1133,7 +1138,7 @@ eina_file_map_free(Eina_File *file, void *map)
unsigned long int key[2]; unsigned long int key[2];
em = eina_hash_find(file->rmap, &map); em = eina_hash_find(file->rmap, &map);
if (!em) return ; if (!em) goto on_exit;
em->refcount--; em->refcount--;