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; std::string oldval = *valueString;
if (pixBuf) if (pixBuf) {
delete[] pixBuf; delete[] pixBuf;
pixBuf = NULL;
}
if (!parent || force_saveScreen) { if (!parent || force_saveScreen) {
pixBuf = new fb_pixel_t[(width + OFFSET_SHADOW) * (height + OFFSET_SHADOW)]; pixBuf = new fb_pixel_t[(width + OFFSET_SHADOW) * (height + OFFSET_SHADOW)];
if (pixBuf) if (pixBuf)

View File

@@ -66,6 +66,7 @@ fprintf(stderr, "%s:%d %s\n", __func__, __LINE__, argv[0]);
if (res) if (res)
*res = ret; *res = ret;
delete y; delete y;
y = NULL;
fprintf(stderr, "%s:%d\n", __func__, __LINE__); fprintf(stderr, "%s:%d\n", __func__, __LINE__);
showResult(); showResult();
} }

View File

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

View File

@@ -97,8 +97,8 @@ YaFT_p::YaFT_p(bool Paint)
YaFT_p::~YaFT_p() YaFT_p::~YaFT_p()
{ {
/* delete NULL is fine */ /* delete NULL is fine */
delete font; delete font; font = NULL;
delete fr; delete fr; fr = NULL;
} }
bool YaFT_p::init() bool YaFT_p::init()
@@ -130,8 +130,8 @@ bool YaFT_p::init()
shell_ttf = ttx_font_file; shell_ttf = ttx_font_file;
if (paint) { if (paint) {
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
delete font; delete font; font = NULL;
delete fr; delete fr; fr = NULL;
fr = new FBFontRenderClass(scalex, scaley); fr = new FBFontRenderClass(scalex, scaley);
fontstyle = fr->AddFont(shell_ttf.c_str()); fontstyle = fr->AddFont(shell_ttf.c_str());
font = fr->getFont(fr->getFamily(shell_ttf.c_str()).c_str(), fontstyle, height / LINES); font = fr->getFont(fr->getFamily(shell_ttf.c_str()).c_str(), fontstyle, height / LINES);