From c177e006fc4a4cfb5e951f678ba8581f5fcb3df1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 25 Apr 2021 16:45:39 +0100 Subject: [PATCH] Use wxScopedPtr instead of manual delete in wxSpinCtrlDouble test No real changes. --- tests/controls/spinctrldbltest.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/controls/spinctrldbltest.cpp b/tests/controls/spinctrldbltest.cpp index 1e834b1915..0308f3e3ea 100644 --- a/tests/controls/spinctrldbltest.cpp +++ b/tests/controls/spinctrldbltest.cpp @@ -224,11 +224,18 @@ TEST_CASE_METHOD(SpinCtrlDoubleTestCase, static inline unsigned int GetInitialDigits(double inc) { - wxSpinCtrlDouble* sc = new wxSpinCtrlDouble(wxTheApp->GetTopWindow(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, - 0, 50, 0, inc); - unsigned int digits = sc->GetDigits(); - delete sc; - return digits; + wxScopedPtr sc(new wxSpinCtrlDouble + ( + wxTheApp->GetTopWindow(), + wxID_ANY, + wxEmptyString, + wxDefaultPosition, + wxDefaultSize, + wxSP_ARROW_KEYS, + 0, 50, 0, + inc + )); + return sc->GetDigits(); } TEST_CASE("SpinCtrlDouble::InitialDigits", "[spinctrldouble][initialdigits]")