From 314cc26f2703bdc8fd0f3fa7199e8cc18f4c5143 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Sun, 13 May 2018 13:32:33 -0500 Subject: [PATCH] Don't leak memory on the dc --- src/GUI/AboutDialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GUI/AboutDialog.cpp b/src/GUI/AboutDialog.cpp index daad5218b..23e893588 100644 --- a/src/GUI/AboutDialog.cpp +++ b/src/GUI/AboutDialog.cpp @@ -83,15 +83,15 @@ AboutDialogLogo::AboutDialogLogo(wxWindow* parent) : void AboutDialogLogo::repaint(wxPaintEvent& event) { - auto dc { new wxPaintDC(this) }; + auto dc = wxPaintDC(this); - dc->SetBackgroundMode(wxPENSTYLE_TRANSPARENT); + dc.SetBackgroundMode(wxPENSTYLE_TRANSPARENT); const auto size {this->GetSize()}; const auto logo_w {this->logo.GetWidth()}; const auto logo_h {this->logo.GetHeight()}; - dc->DrawBitmap(this->logo, (size.GetWidth() - logo_w) / 2, (size.GetHeight() - logo_h) / 2, 1); + dc.DrawBitmap(this->logo, (size.GetWidth() - logo_w) / 2, (size.GetHeight() - logo_h) / 2, 1); event.Skip(); }