summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_file_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eina/eina_file_common.c')
-rw-r--r--src/lib/eina/eina_file_common.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c
index 7b05b3b249..7f83c87774 100644
--- a/src/lib/eina/eina_file_common.c
+++ b/src/lib/eina/eina_file_common.c
@@ -451,17 +451,20 @@ eina_file_close(Eina_File *file)
451 451
452 EINA_SAFETY_ON_NULL_RETURN(file); 452 EINA_SAFETY_ON_NULL_RETURN(file);
453 453
454 eina_lock_take(&_eina_file_lock_cache);
455
454 eina_lock_take(&file->lock); 456 eina_lock_take(&file->lock);
455 file->refcount--; 457 file->refcount--;
456 if (file->refcount == 0) leave = EINA_FALSE; 458 if (file->refcount == 0) leave = EINA_FALSE;
457 eina_lock_release(&file->lock); 459 eina_lock_release(&file->lock);
458 if (leave) return; 460 if (leave) goto end;
459
460 eina_lock_take(&_eina_file_lock_cache);
461 461
462 eina_hash_del(_eina_file_cache, file->filename, file); 462 eina_hash_del(_eina_file_cache, file->filename, file);
463
464 // Backend specific file resource close
463 eina_file_real_close(file); 465 eina_file_real_close(file);
464 466
467 end:
465 eina_lock_release(&_eina_file_lock_cache); 468 eina_lock_release(&_eina_file_lock_cache);
466} 469}
467 470