mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-22 05:45:38 +00:00
NetBoard: guard against freeing null pointers and INetBoard needed a virtual destructor (was causing crashes on exit on some systems)
This commit is contained in:
parent
3848d276da
commit
b5ca365928
|
@ -30,6 +30,10 @@
|
||||||
class INetBoard
|
class INetBoard
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~INetBoard()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
virtual void SaveState(CBlockFile* SaveState) = 0;
|
virtual void SaveState(CBlockFile* SaveState) = 0;
|
||||||
virtual void LoadState(CBlockFile* SaveState) = 0;
|
virtual void LoadState(CBlockFile* SaveState) = 0;
|
||||||
|
|
||||||
|
|
|
@ -111,11 +111,11 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SAFE_DELETE
|
#ifndef SAFE_DELETE
|
||||||
#define SAFE_DELETE(p) delete (p); (p) = NULL;
|
#define SAFE_DELETE(p) if (p != nullptr) { delete (p); (p) = NULL; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SAFE_ARRAY_DELETE
|
#ifndef SAFE_ARRAY_DELETE
|
||||||
#define SAFE_ARRAY_DELETE(x) delete[] x; x = NULL;
|
#define SAFE_ARRAY_DELETE(x) if (x != nullptr) { delete[] x; x = NULL; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int(*Runnet68kCB)(int cycles);
|
static int(*Runnet68kCB)(int cycles);
|
||||||
|
@ -667,7 +667,7 @@ void CNetBoard::Write8(UINT32 a, UINT8 d)
|
||||||
case 0x80:
|
case 0x80:
|
||||||
nets->Send((const char*)CommRAM + send_offset, send_size);
|
nets->Send((const char*)CommRAM + send_offset, send_size);
|
||||||
DebugLog("send enable off=%x size=%x\n", send_offset, send_size);
|
DebugLog("send enable off=%x size=%x\n", send_offset, send_size);
|
||||||
|
|
||||||
#ifdef NET_DEBUG
|
#ifdef NET_DEBUG
|
||||||
DebugLog("transmitting : ");
|
DebugLog("transmitting : ");
|
||||||
if (send_size > 50) //too big for print, so...
|
if (send_size > 50) //too big for print, so...
|
||||||
|
|
Loading…
Reference in a new issue