summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_file_common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c
index ac7d020eb5..e5b1250e09 100644
--- a/src/lib/eina/eina_file_common.c
+++ b/src/lib/eina/eina_file_common.c
@@ -445,12 +445,15 @@ eina_file_dup(Eina_File *file)
445EAPI void 445EAPI void
446eina_file_close(Eina_File *file) 446eina_file_close(Eina_File *file)
447{ 447{
448 Eina_Bool leave = EINA_TRUE;
449
448 EINA_SAFETY_ON_NULL_RETURN(file); 450 EINA_SAFETY_ON_NULL_RETURN(file);
449 451
450 eina_lock_take(&file->lock); 452 eina_lock_take(&file->lock);
451 file->refcount--; 453 file->refcount--;
454 if (file->refcount == 0) leave = EINA_FALSE;
452 eina_lock_release(&file->lock); 455 eina_lock_release(&file->lock);
453 if (file->refcount != 0) return; 456 if (leave) return;
454 457
455 eina_lock_take(&_eina_file_lock_cache); 458 eina_lock_take(&_eina_file_lock_cache);
456 459