From 1378ef4ad0e079e4d66bc07dbcb989673dd55592 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 26 Nov 2013 15:35:36 +0400 Subject: [PATCH] gui/components/cc_item_infobox.cpp: fix memleak: CComponentsInfoBox ctor -> CComponentsText ctor -> initCCText(), initVarInfobox() -> initVarText() -> created ct_textbox = NULL, pointer lost; comment calls in CComponentsInfoBox dtor, which already called from base CComponentsText dtor --- src/gui/components/cc_item_infobox.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index ff1b30bfb..af3027911 100644 --- a/src/gui/components/cc_item_infobox.cpp +++ b/src/gui/components/cc_item_infobox.cpp @@ -66,18 +66,22 @@ CComponentsInfoBox::CComponentsInfoBox(const int x_pos, const int y_pos, const i CComponentsInfoBox::~CComponentsInfoBox() { +#if 0 // called from base (CComponentsText) dtor hide(); clearSavedScreen(); clearCCText(); + clear(); +#endif delete pic; delete cctext; - clear(); } void CComponentsInfoBox::initVarInfobox() { //CComponents, CComponentsItem, CComponentsText +#if 0 // called from base (CComponentsText) ctor initVarText(); +#endif cc_item_type = CC_ITEMTYPE_TEXT_INFOBOX; //CComponentsInfoBox