diff --git a/libretro/syscalls.c b/libretro/syscalls.c index 4cd1fc5ae6..8e55751c6b 100644 --- a/libretro/syscalls.c +++ b/libretro/syscalls.c @@ -135,8 +135,14 @@ int _open_r(struct _reent *reent, const char* name, int flags, int mode) int _close_r(struct _reent *reent, int fd) { - if(fd >= kMacRefNumOffset) - FSClose(fd - kMacRefNumOffset); + if(fd >= kMacRefNumOffset) { + short refNum = fd - kMacRefNumOffset; + short vRefNum; + OSErr err = GetVRefNum(refNum, &vRefNum); + FSClose(refNum); + if (err == noErr) + FlushVol(NULL, vRefNum); + } return 0; }