From e32f62315e775331c03e5d0c9c396c759d15cb34 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 e575e913291d8506cc449b33e046dc2574ca61d8 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d7ce8474712d42e0305c8a8f6202dcc09ea83fda Author: Thilo Graf Date: 2013-04-06 (Sat, 06 Apr 2013) ------------------ This commit was generated by Migit --- 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