BTBase: Fix a file deletion issue on Windows

> The process cannot access the file because it is being used by another process.
This commit is contained in:
Léo Lam 2017-08-09 11:50:13 +08:00
parent 942edf504c
commit 71f403d05b
1 changed files with 9 additions and 7 deletions

View File

@ -38,6 +38,7 @@ void BackUpBTInfoSection(const SysConf* sysconf)
void RestoreBTInfoSection(SysConf* sysconf)
{
const std::string filename = File::GetUserPath(D_CONFIG_IDX) + DIR_SEP WII_BTDINF_BACKUP;
{
File::IOFile backup(filename, "rb");
if (!backup)
return;
@ -47,6 +48,7 @@ void RestoreBTInfoSection(SysConf* sysconf)
ERROR_LOG(IOS_WIIMOTE, "Failed to read backed up BT.DINF section");
return;
}
}
File::Delete(filename);
}