perfect: Add try...cache to deleteBoard()

This commit is contained in:
Calcitem 2021-01-31 09:50:19 +08:00
parent 41b12606ce
commit 0eaf8d5134
1 changed files with 6 additions and 2 deletions

View File

@ -228,8 +228,12 @@ void fieldStruct::createBoard()
//-----------------------------------------------------------------------------
void fieldStruct::deleteBoard()
{
SAFE_DELETE(curPlayer);
SAFE_DELETE(oppPlayer);
try {
SAFE_DELETE(curPlayer);
SAFE_DELETE(oppPlayer);
} catch (const char *msg) {
cerr << msg << endl;
}
}
//-----------------------------------------------------------------------------