From 0eaf8d51347f00872ceb2fc365594e6d5e047808 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sun, 31 Jan 2021 09:50:19 +0800 Subject: [PATCH] perfect: Add try...cache to deleteBoard() --- src/perfect/millAI.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/perfect/millAI.cpp b/src/perfect/millAI.cpp index 117cf429..17619c2d 100644 --- a/src/perfect/millAI.cpp +++ b/src/perfect/millAI.cpp @@ -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; + } } //-----------------------------------------------------------------------------