CInfoViewer: ensure hide on deleted info file

This commit is contained in:
2013-04-25 23:06:35 +02:00
parent f774eb833f
commit e30f4d2764

View File

@@ -1818,8 +1818,11 @@ void CInfoViewer::showInfoFile()
//exit if file not found, don't create an info object, delete old instance if required
if (!file_size(infobar_file.c_str())) {
if (infobar_txt)
if (infobar_txt){
if (infobar_txt->isPainted())
infobar_txt->hide();
delete infobar_txt;
}
infobar_txt = NULL;
return;
}
@@ -1847,9 +1850,13 @@ void CInfoViewer::showInfoFile()
infobar_txt->setDimensionsAll(xStart, yStart, width, height);
infobar_txt->setCornerRadius(RADIUS_SMALL);
infobar_txt->setShadowOnOff(true);
infobar_txt->setColorBody(COL_INFOBAR_PLUS_0);
infobar_txt->doPaintTextBoxBg(false);
//paint info, don't save backscreen, if already painted, global hide is done by killTitle()
bool save_bg = !infobar_txt->isPainted();
infobar_txt->paint(save_bg);
//paint info, don't save backscreen, hide not needed, is already done by killTitle()
infobar_txt->paint(CC_SAVE_SCREEN_NO);
}
void CInfoViewer::killTitle()