CComponentsInfoBox: move statement for check of image name

Ensure empty pic object otherwise it can be retained on exit
of paintPicture(), if an instance of Infobox already exists.

supplement to 095c0e1b04
This commit is contained in:
2013-04-06 08:49:16 +02:00
parent f70a30defa
commit d7ce847471

View File

@@ -91,12 +91,16 @@ void CComponentsInfoBox::initVarInfobox()
void CComponentsInfoBox::paintPicture()
{
//ensure empty pic object
if (pic)
delete pic;
pic = NULL;
//exit if no image definied
if (pic_name == "")
return;
//init and set icon paint position
if (pic)
delete pic;
//init pic object and set icon paint position
pic = new CComponentsPicture(x+fr_thickness+x_offset, y+fr_thickness/*+y_offset*/, 0, 0, "");
//define icon