From 8cca903780688c2344e0200b76291209252f9a06 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Oct 2019 16:24:47 +0100 Subject: [PATCH] widget: reset some deleted vars only to be shure --- src/gui/widget/keyboard_input.cpp | 4 +++- src/gui/widget/termwindow.cpp | 1 + src/gui/widget/yaft/yaft_class.cpp | 1 + src/gui/widget/yaft/yaft_priv.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/keyboard_input.cpp b/src/gui/widget/keyboard_input.cpp index 894994ced..733ce9e4a 100644 --- a/src/gui/widget/keyboard_input.cpp +++ b/src/gui/widget/keyboard_input.cpp @@ -463,8 +463,10 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) std::string oldval = *valueString; - if (pixBuf) + if (pixBuf) { delete[] pixBuf; + pixBuf = NULL; + } if (!parent || force_saveScreen) { pixBuf = new fb_pixel_t[(width + OFFSET_SHADOW) * (height + OFFSET_SHADOW)]; if (pixBuf) diff --git a/src/gui/widget/termwindow.cpp b/src/gui/widget/termwindow.cpp index d5fc02d8d..14a4f99d3 100644 --- a/src/gui/widget/termwindow.cpp +++ b/src/gui/widget/termwindow.cpp @@ -66,6 +66,7 @@ fprintf(stderr, "%s:%d %s\n", __func__, __LINE__, argv[0]); if (res) *res = ret; delete y; + y = NULL; fprintf(stderr, "%s:%d\n", __func__, __LINE__); showResult(); } diff --git a/src/gui/widget/yaft/yaft_class.cpp b/src/gui/widget/yaft/yaft_class.cpp index 5d1b12e48..002e6b98e 100644 --- a/src/gui/widget/yaft/yaft_class.cpp +++ b/src/gui/widget/yaft/yaft_class.cpp @@ -211,5 +211,6 @@ exec_failed: sigaction(SIGCHLD, &oldact, NULL); init_failed: delete term; + term = NULL; return exitcode; } diff --git a/src/gui/widget/yaft/yaft_priv.cpp b/src/gui/widget/yaft/yaft_priv.cpp index 6bc37d029..ccf243b61 100644 --- a/src/gui/widget/yaft/yaft_priv.cpp +++ b/src/gui/widget/yaft/yaft_priv.cpp @@ -97,8 +97,8 @@ YaFT_p::YaFT_p(bool Paint) YaFT_p::~YaFT_p() { /* delete NULL is fine */ - delete font; - delete fr; + delete font; font = NULL; + delete fr; fr = NULL; } bool YaFT_p::init() @@ -130,8 +130,8 @@ bool YaFT_p::init() shell_ttf = ttx_font_file; if (paint) { for (int i = 0; i < 2; i++) { - delete font; - delete fr; + delete font; font = NULL; + delete fr; fr = NULL; fr = new FBFontRenderClass(scalex, scaley); fontstyle = fr->AddFont(shell_ttf.c_str()); font = fr->getFont(fr->getFamily(shell_ttf.c_str()).c_str(), fontstyle, height / LINES);