eina: forgotten lock in eina_file.

SVN revision: 63786
This commit is contained in:
Cedric BAIL 2011-10-04 01:55:41 +00:00
parent 157224ffef
commit 49fa59342f
1 changed files with 11 additions and 3 deletions

View File

@ -799,7 +799,11 @@ eina_file_open(const char *filename, Eina_Bool shared)
if (!file)
{
n = malloc(sizeof (Eina_File) + strlen(filename) + 1);
if (!n) goto on_error;
if (!n)
{
eina_lock_release(&_eina_file_lock_cache);
goto on_error;
}
n->filename = (char*) (n + 1);
strcpy((char*) n->filename, filename);
@ -849,7 +853,11 @@ eina_file_close(Eina_File *file)
eina_lock_release(&file->lock);
if (file->refcount != 0) return;
eina_lock_take(&_eina_file_lock_cache);
eina_hash_del(_eina_file_cache, file->filename, file);
eina_lock_release(&_eina_file_lock_cache);
}
EAPI size_t