mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
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:
@ -38,14 +38,16 @@ void BackUpBTInfoSection(const SysConf* sysconf)
|
|||||||
void RestoreBTInfoSection(SysConf* sysconf)
|
void RestoreBTInfoSection(SysConf* sysconf)
|
||||||
{
|
{
|
||||||
const std::string filename = File::GetUserPath(D_CONFIG_IDX) + DIR_SEP WII_BTDINF_BACKUP;
|
const std::string filename = File::GetUserPath(D_CONFIG_IDX) + DIR_SEP WII_BTDINF_BACKUP;
|
||||||
File::IOFile backup(filename, "rb");
|
|
||||||
if (!backup)
|
|
||||||
return;
|
|
||||||
auto& section = sysconf->GetOrAddEntry("BT.DINF", SysConf::Entry::Type::BigArray)->bytes;
|
|
||||||
if (!backup.ReadBytes(section.data(), section.size()))
|
|
||||||
{
|
{
|
||||||
ERROR_LOG(IOS_WIIMOTE, "Failed to read backed up BT.DINF section");
|
File::IOFile backup(filename, "rb");
|
||||||
return;
|
if (!backup)
|
||||||
|
return;
|
||||||
|
auto& section = sysconf->GetOrAddEntry("BT.DINF", SysConf::Entry::Type::BigArray)->bytes;
|
||||||
|
if (!backup.ReadBytes(section.data(), section.size()))
|
||||||
|
{
|
||||||
|
ERROR_LOG(IOS_WIIMOTE, "Failed to read backed up BT.DINF section");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
File::Delete(filename);
|
File::Delete(filename);
|
||||||
|
Reference in New Issue
Block a user