From 604d4e0f9963b41b63f6f49e758fa500c550c50c 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 ab59797ae5e1b6c9b7edcbb4e938c95fd7115396 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d7ce8474712d42e0305c8a8f6202dcc09ea83fda Author: Thilo Graf Date: 2013-04-06 (Sat, 06 Apr 2013) --- 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