From a8c59c41bc103f0336d9982369be5dd85ac68111 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 28 Feb 2022 18:51:47 +0100 Subject: Fix majors memory leaks (TODO: shared_ptr for Game objects and implement ~Game()) --- src/base_tab/AppendGameDialog.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/base_tab/AppendGameDialog.cpp') diff --git a/src/base_tab/AppendGameDialog.cpp b/src/base_tab/AppendGameDialog.cpp index d8fe996..a4ac126 100644 --- a/src/base_tab/AppendGameDialog.cpp +++ b/src/base_tab/AppendGameDialog.cpp @@ -17,8 +17,11 @@ AppendGameDialog::AppendGameDialog(wxWindow *parent, GameBase *base) ID_DIALOG_CANCEL_BUTTON); Bind(wxEVT_BUTTON, &AppendGameDialog::OnImport, this, ID_DIALOG_IMPORT_BUTTON); + Bind(wxEVT_CLOSE_WINDOW, &AppendGameDialog::OnClose, this); } +void AppendGameDialog::OnClose(wxCloseEvent &e) { Destroy(); } + void AppendGameDialog::OnCancel(wxCommandEvent &event) { this->Close(); } void AppendGameDialog::OnImport(wxCommandEvent &event) { -- cgit v1.2.3