diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2017-08-09 11:50:13 +0800 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2017-08-10 23:30:52 +0800 |
| commit | 71f403d05bbf90be451211e3606be405e555eedb (patch) | |
| tree | aedfe03c05a3bca4114f067b4d3f44b4e9241700 /Source/Core | |
| parent | 942edf504cd2b6da53be6718a591b4846b5e93a3 (diff) | |
BTBase: Fix a file deletion issue on Windows
> The process cannot access the file because it is being used by another process.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp b/Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp index 75e8fef2a0..c4770253d6 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp @@ -38,14 +38,16 @@ 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; - 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::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"); + return; + } } File::Delete(filename); |
