From 9886c25645d3808ef51058c3024bd17948c77f68 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 2 Feb 2019 17:40:33 +0100 Subject: [PATCH] Ensure that test notebook is destroyed after the end of its test Don't let wxNotebook created in the recently added test for the events generated when adding pages to it continue to live after the test end as this breaks the subsequent tests using wxUIActionSimulator (but only when using MinGW, for some reason). --- tests/controls/notebooktest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/controls/notebooktest.cpp b/tests/controls/notebooktest.cpp index 60c9cdd31b..d8f80e40a2 100644 --- a/tests/controls/notebooktest.cpp +++ b/tests/controls/notebooktest.cpp @@ -20,6 +20,7 @@ #endif // WX_PRECOMP #include "wx/notebook.h" +#include "wx/scopedptr.h" #include "bookctrlbasetest.h" #include "testableframe.h" @@ -125,6 +126,7 @@ TEST_CASE("wxNotebook::AddPageEvents", "[wxNotebook][AddPage][event]") wxNotebook* const notebook = new wxNotebook(wxTheApp->GetTopWindow(), wxID_ANY, wxDefaultPosition, wxSize(400, 200)); + wxScopedPtr cleanup(notebook); CHECK( notebook->GetSelection() == wxNOT_FOUND );