mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-04-10 19:15:14 +00:00
use the correct c++ deleters
This commit is contained in:
parent
19e6aab1fa
commit
dc3048df24
|
@ -90,6 +90,14 @@
|
||||||
#define DPRINTF(a, ...)
|
#define DPRINTF(a, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef SAFE_DELETE
|
||||||
|
#define SAFE_DELETE(p) delete (p); (p) = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SAFE_ARRAY_DELETE
|
||||||
|
#define SAFE_ARRAY_DELETE(x) delete[] x; x = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace SMUDP;
|
using namespace SMUDP;
|
||||||
|
|
||||||
static int(*Runnet68kCB)(int cycles);
|
static int(*Runnet68kCB)(int cycles);
|
||||||
|
@ -1225,6 +1233,8 @@ bool CNetBoard::Init(UINT8 * netRAMPtr, UINT8 *netBufferPtr)
|
||||||
CNetBoard::CNetBoard(const Util::Config::Node &config) : m_config(config)
|
CNetBoard::CNetBoard(const Util::Config::Node &config) : m_config(config)
|
||||||
{
|
{
|
||||||
memoryPool = NULL;
|
memoryPool = NULL;
|
||||||
|
bank = NULL;
|
||||||
|
ct = NULL;
|
||||||
netRAM = NULL;
|
netRAM = NULL;
|
||||||
netBuffer = NULL;
|
netBuffer = NULL;
|
||||||
Buffer = NULL;
|
Buffer = NULL;
|
||||||
|
@ -1232,7 +1242,6 @@ CNetBoard::CNetBoard(const Util::Config::Node &config) : m_config(config)
|
||||||
CommRAM = NULL;
|
CommRAM = NULL;
|
||||||
ioreg = NULL;
|
ioreg = NULL;
|
||||||
ctrlrw = NULL;
|
ctrlrw = NULL;
|
||||||
bank = NULL;
|
|
||||||
|
|
||||||
CodeReady = false;
|
CodeReady = false;
|
||||||
test_irq = 0;
|
test_irq = 0;
|
||||||
|
@ -1242,11 +1251,9 @@ CNetBoard::CNetBoard(const Util::Config::Node &config) : m_config(config)
|
||||||
|
|
||||||
CNetBoard::~CNetBoard(void)
|
CNetBoard::~CNetBoard(void)
|
||||||
{
|
{
|
||||||
if (memoryPool != NULL)
|
SAFE_ARRAY_DELETE(memoryPool);
|
||||||
{
|
SAFE_ARRAY_DELETE(bank);
|
||||||
delete[] memoryPool;
|
SAFE_ARRAY_DELETE(ct);
|
||||||
memoryPool = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
netRAM = NULL;
|
netRAM = NULL;
|
||||||
netBuffer = NULL;
|
netBuffer = NULL;
|
||||||
|
@ -1256,18 +1263,6 @@ CNetBoard::~CNetBoard(void)
|
||||||
ioreg = NULL;
|
ioreg = NULL;
|
||||||
ctrlrw = NULL;
|
ctrlrw = NULL;
|
||||||
|
|
||||||
if (bank != NULL)
|
|
||||||
{
|
|
||||||
delete bank;
|
|
||||||
bank = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ct != NULL)
|
|
||||||
{
|
|
||||||
delete ct;
|
|
||||||
ct = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*if (int5 == true)
|
/*if (int5 == true)
|
||||||
{
|
{
|
||||||
int5 = false;
|
int5 = false;
|
||||||
|
@ -1290,9 +1285,6 @@ bool CNetBoard::RunFrame(void)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
M68KSetContext(&M68K);
|
M68KSetContext(&M68K);
|
||||||
|
|
||||||
/*if (int5 == false)
|
/*if (int5 == false)
|
||||||
|
|
|
@ -54,7 +54,6 @@ private:
|
||||||
UINT8 *ioreg;
|
UINT8 *ioreg;
|
||||||
UINT8 *ctrlrw;
|
UINT8 *ctrlrw;
|
||||||
UINT8 *Buffer;
|
UINT8 *Buffer;
|
||||||
UINT8 *Buffer2;
|
|
||||||
UINT8 *RAM;
|
UINT8 *RAM;
|
||||||
UINT8 *ct;
|
UINT8 *ct;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue