eet: for more safety let eet handle the reference to the file.

This commit is contained in:
Cedric Bail 2013-06-04 15:03:47 +09:00
parent 06cd16548c
commit dba4a080d9
1 changed files with 2 additions and 2 deletions

View File

@ -1450,7 +1450,7 @@ eet_mmap(Eina_File *file)
INIT_FILE(ef);
ef->ed = NULL;
ef->key = NULL;
ef->readfp = file;
ef->readfp = eina_file_dup(file);
ef->path = eina_stringshare_add(path);
ef->magic = EET_MAGIC_FILE;
ef->references = 1;
@ -1462,7 +1462,7 @@ eet_mmap(Eina_File *file)
ef->data_size = 0;
ef->sha1 = NULL;
ef->sha1_length = 0;
ef->readfp_owned = EINA_FALSE;
ef->readfp_owned = EINA_TRUE;
ef->data_size = eina_file_size_get(file);
ef->data = eina_file_map_all(file, EINA_FILE_SEQUENTIAL);