mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 15:01:16 +01:00
Fix a potential memory leak on non-windows systems.
Also added a FIXME to BPStructs.cpp and BPMemLoader.cpp
This commit is contained in:
parent
f69b6b595e
commit
2db0c4270e
@ -512,12 +512,24 @@ bool DeleteDirRecursively(const std::string &directory)
|
|||||||
if (IsDirectory(newPath))
|
if (IsDirectory(newPath))
|
||||||
{
|
{
|
||||||
if (!DeleteDirRecursively(newPath))
|
if (!DeleteDirRecursively(newPath))
|
||||||
|
{
|
||||||
|
#ifndef _WIN32
|
||||||
|
closedir(dirp);
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!File::Delete(newPath))
|
if (!File::Delete(newPath))
|
||||||
|
{
|
||||||
|
#ifndef _WIN32
|
||||||
|
closedir(dirp);
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -519,6 +519,7 @@ void BPWritten(const BPCmd& bp)
|
|||||||
|
|
||||||
for (u32 i = 0; i < tmem_cfg.preload_tile_info.count; ++i)
|
for (u32 i = 0; i < tmem_cfg.preload_tile_info.count; ++i)
|
||||||
{
|
{
|
||||||
|
// FIXME: Duplicate conditions.
|
||||||
if (tmem_addr_even + TMEM_LINE_SIZE > TMEM_SIZE ||
|
if (tmem_addr_even + TMEM_LINE_SIZE > TMEM_SIZE ||
|
||||||
tmem_addr_even + TMEM_LINE_SIZE > TMEM_SIZE)
|
tmem_addr_even + TMEM_LINE_SIZE > TMEM_SIZE)
|
||||||
break;
|
break;
|
||||||
|
@ -137,6 +137,7 @@ void SWBPWritten(int address, int newvalue)
|
|||||||
|
|
||||||
for (int i = 0; i < tmem_cfg.preload_tile_info.count; ++i)
|
for (int i = 0; i < tmem_cfg.preload_tile_info.count; ++i)
|
||||||
{
|
{
|
||||||
|
// FIXME: Duplicate conditions
|
||||||
if (tmem_addr_even + TMEM_LINE_SIZE > TMEM_SIZE ||
|
if (tmem_addr_even + TMEM_LINE_SIZE > TMEM_SIZE ||
|
||||||
tmem_addr_even + TMEM_LINE_SIZE > TMEM_SIZE)
|
tmem_addr_even + TMEM_LINE_SIZE > TMEM_SIZE)
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user