diff options
Diffstat (limited to 'src/game_tab')
| -rw-r--r-- | src/game_tab/left_panel/board/BoardCanvas.cpp | 5 | ||||
| -rw-r--r-- | src/game_tab/left_panel/board/BoardCanvas.hpp | 1 | ||||
| -rw-r--r-- | src/game_tab/right_panel/LiveEngineDialog.cpp | 10 | ||||
| -rw-r--r-- | src/game_tab/right_panel/LiveEngineDialog.hpp | 1 |
4 files changed, 15 insertions, 2 deletions
diff --git a/src/game_tab/left_panel/board/BoardCanvas.cpp b/src/game_tab/left_panel/board/BoardCanvas.cpp index 237a68a..4b5f3fb 100644 --- a/src/game_tab/left_panel/board/BoardCanvas.cpp +++ b/src/game_tab/left_panel/board/BoardCanvas.cpp @@ -14,6 +14,11 @@ BoardCanvas::BoardCanvas(wxFrame *parent) ApplyPreferences(); } +BoardCanvas::~BoardCanvas() { + delete t; + delete t_captures; +} + BoardCanvas::BoardCanvas(wxFrame *parent, std::uint32_t square_width, bool frozen) : BoardCanvas(parent) { diff --git a/src/game_tab/left_panel/board/BoardCanvas.hpp b/src/game_tab/left_panel/board/BoardCanvas.hpp index 34c4911..83c960a 100644 --- a/src/game_tab/left_panel/board/BoardCanvas.hpp +++ b/src/game_tab/left_panel/board/BoardCanvas.hpp @@ -54,6 +54,7 @@ class BoardCanvas : public wxPanel { public: BoardCanvas(wxFrame *parent); BoardCanvas(wxFrame *parent,std::uint32_t square_width, bool frozen); + ~BoardCanvas(); void ApplyPreferences(); void DrawBoard(wxPaintDC &dc); void OnPaint(wxPaintEvent &event); diff --git a/src/game_tab/right_panel/LiveEngineDialog.cpp b/src/game_tab/right_panel/LiveEngineDialog.cpp index 1f509ae..73d3eb3 100644 --- a/src/game_tab/right_panel/LiveEngineDialog.cpp +++ b/src/game_tab/right_panel/LiveEngineDialog.cpp @@ -13,6 +13,13 @@ LiveEngineDialog::LiveEngineDialog(wxWindow *parent, std::string engine_name) Bind(wxEVT_CLOSE_WINDOW, &LiveEngineDialog::OnClose, this); } +LiveEngineDialog::~LiveEngineDialog() { + if (engine != NULL) { + wxLogDebug("LiveEngineDialog destructor: delete engine"); + delete engine; + } +} + void LiveEngineDialog::InitEngine() { if (engine == NULL) { wxLogDebug("Start engine: %s", engine_name); @@ -51,9 +58,8 @@ void LiveEngineDialog::OnClose(wxCloseEvent &e) { timer.Stop(); engine->stop(); engine->quit(); - delete engine; } - e.Skip(); + Destroy(); } void LiveEngineDialog::SetFEN(std::string fen) { diff --git a/src/game_tab/right_panel/LiveEngineDialog.hpp b/src/game_tab/right_panel/LiveEngineDialog.hpp index 999002f..0996ba0 100644 --- a/src/game_tab/right_panel/LiveEngineDialog.hpp +++ b/src/game_tab/right_panel/LiveEngineDialog.hpp @@ -10,6 +10,7 @@ class LiveEngineDialog : public DialogLiveEngine { public: LiveEngineDialog(wxWindow *parent, std::string engine_name); + ~LiveEngineDialog(); void InitEngine(); void TogglePauseEngine(wxCommandEvent &event); void OnTimerTick(wxTimerEvent &event); |
