From a306a747a12e19aec4edf0fb90d525ba895245c1 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 3 Jan 2016 18:56:19 +0100 Subject: [PATCH] CShellWindow: fix "OK" button after shell window Allocating the CComponentsButton object on the stack does not really work here, because it goes immediately out of scope and is thus deleted. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8e43498ea5bfc9486eff74929508634c83ba45aa Author: Stefan Seyfried Date: 2016-01-03 (Sun, 03 Jan 2016) --- src/gui/widget/shellwindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/shellwindow.cpp b/src/gui/widget/shellwindow.cpp index 308ceaa8d..f2e6b5f6f 100644 --- a/src/gui/widget/shellwindow.cpp +++ b/src/gui/widget/shellwindow.cpp @@ -245,13 +245,14 @@ void CShellWindow::showResult() } if ((mode & VERBOSE)){ + CComponentsButton *btn = NULL; if (show_button){ int b_width = 150; int b_height = 35; int xpos = frameBuffer->getScreenWidth() - b_width; int ypos = frameBuffer->getScreenHeight() - b_height; - CComponentsButton btn(xpos, ypos, b_width, b_height, LOCALE_MESSAGEBOX_BACK, NEUTRINO_ICON_BUTTON_OKAY, NULL, true, true); - btn.paint(); + btn = new CComponentsButton(xpos, ypos, b_width, b_height, LOCALE_MESSAGEBOX_BACK, NEUTRINO_ICON_BUTTON_OKAY, NULL, true, true); + btn->paint(false); /* saving background is not really needed */ } neutrino_msg_t msg; @@ -264,6 +265,8 @@ void CShellWindow::showResult() g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd); while (msg != CRCInput::RC_ok && msg != CRCInput::RC_home && msg != CRCInput::RC_timeout); } + if (btn) + delete btn; textBox->hide(); } }