From c5e05524381a71a4352983c83d30e0b86d053989 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 6 Jun 2013 03:37:40 +0200 Subject: [PATCH] CTestMenu: Fix memleak --- src/gui/test_menu.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 17081a09f..aebf045d5 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -567,8 +567,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (clock_r->isClockRun()){ if (clock_r->Stop()){ clock_r->hide(); - delete clock; - clock = NULL; + delete clock_r; + clock_r = NULL; return menu_return::RETURN_EXIT_ALL;; } } @@ -581,9 +581,11 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) if (!clock->isPainted()) clock->paint(); - else + else { clock->hide(); - + delete clock; + clock = NULL; + } return res; }