Fix T92681: resolve use of freed filedescriptor in debug builds

Ref D13053
This commit is contained in:
Martijn Versteegh 2021-11-01 21:43:18 +11:00 committed by Campbell Barton
parent 2a4dfaa0e9
commit 3df587b798
Notes: blender-bot 2023-02-14 11:00:17 +01:00
Referenced by issue #92681, File descriptor used after closing the file.
1 changed files with 1 additions and 1 deletions

View File

@ -1351,7 +1351,6 @@ FileData *blo_filedata_from_memfile(MemFile *memfile,
void blo_filedata_free(FileData *fd)
{
if (fd) {
fd->file->close(fd->file);
/* Free all BHeadN data blocks */
#ifndef NDEBUG
@ -1365,6 +1364,7 @@ void blo_filedata_free(FileData *fd)
MEM_freeN(new_bhead);
}
#endif
fd->file->close(fd->file);
if (fd->filesdna) {
DNA_sdna_free(fd->filesdna);