From 25c40a63dd5d4ed6efd09ee535dfa737e5951dfe Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 Jul 2013 18:35:25 +0200 Subject: [PATCH] CComponentsText: remove delete of CBox() object Obtain of one instance of CBox() should working just as like a new instance. --- src/gui/components/cc_item_text.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index 33d828b99..e5f758398 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -118,20 +118,15 @@ void CComponentsText::initCCText() //define height from font size height = max(height, ct_font->getHeight()); - //text box dimensions - if (ct_box== NULL){ - //ensure that we have a new instance - delete ct_box; - ct_box = NULL; - } - //using of real x/y values to paint images if this text object is bound in a parent form int tx = x, ty = y; if (cc_parent){ tx = cc_xr; ty = cc_yr; } - ct_box = new CBox(); + //init text box dimensions + if (ct_box == NULL) + ct_box = new CBox(); ct_box->iX = tx+fr_thickness; ct_box->iY = ty+fr_thickness; ct_box->iWidth = width-2*fr_thickness;