widget: reset some deleted vars

only to be shure
This commit is contained in:
2019-10-27 16:24:47 +01:00
parent bcf4fbdc87
commit 8cca903780
4 changed files with 9 additions and 5 deletions

View File

@@ -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)

View File

@@ -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();
}

View File

@@ -211,5 +211,6 @@ exec_failed:
sigaction(SIGCHLD, &oldact, NULL);
init_failed:
delete term;
term = NULL;
return exitcode;
}

View File

@@ -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);