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
|
||||
{
|
||||
public:
|
||||
virtual ~INetBoard()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void SaveState(CBlockFile* SaveState) = 0;
|
||||
virtual void LoadState(CBlockFile* SaveState) = 0;
|
||||
|
||||
|
|
|
@ -111,11 +111,11 @@
|
|||
#endif
|
||||
|
||||
#ifndef SAFE_DELETE
|
||||
#define SAFE_DELETE(p) delete (p); (p) = NULL;
|
||||
#define SAFE_DELETE(p) if (p != nullptr) { delete (p); (p) = NULL; }
|
||||
#endif
|
||||
|
||||
#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
|
||||
|
||||
static int(*Runnet68kCB)(int cycles);
|
||||
|
|
Loading…
Reference in a new issue