From 0fa2bbc7c9ed6aed9524d925e6507cb09d578691 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 18 Mar 2013 10:16:24 +0100 Subject: [PATCH] CComponentsInfoBox: delete clean textbox object before create new object Ensures a clean environment for changed properties of a textbox in infobox. --- src/gui/components/cc_item_infobox.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index adc92c5eb..d8c248118 100644 --- a/src/gui/components/cc_item_infobox.cpp +++ b/src/gui/components/cc_item_infobox.cpp @@ -123,8 +123,10 @@ void CComponentsInfoBox::paint(bool do_save_bg) //set text and paint text lines if (ct_text){ - if (cctext == NULL) - cctext = new CComponentsText(); + if (cctext) + delete cctext; + + cctext = new CComponentsText(); cctext->setText(ct_text, ct_text_mode, ct_font); cctext->setDimensionsAll(x_text, y+fr_thickness, width-(x_text-x+x_offset+fr_thickness), height-2*fr_thickness); cctext->paint(CC_SAVE_SCREEN_NO);