From d7ce8474712d42e0305c8a8f6202dcc09ea83fda Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 6 Apr 2013 08:49:16 +0200 Subject: [PATCH] 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 095c0e1b045898cbb7abdf363227e0f0690cf1a6 --- src/gui/components/cc_item_infobox.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index b4954a6c8..fb8eaa9c0 100644 --- a/src/gui/components/cc_item_infobox.cpp +++ b/src/gui/components/cc_item_infobox.cpp @@ -91,12 +91,16 @@ void CComponentsInfoBox::initVarInfobox() void CComponentsInfoBox::paintPicture() { - if (pic_name == "") - return; - - //init and set icon paint position + //ensure empty pic object if (pic) delete pic; + pic = NULL; + + //exit if no image definied + if (pic_name == "") + return; + + //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