From 71884de80e3f13f0c4808e7cda0a2578636441f3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 25 Jun 2013 10:58:33 +0200 Subject: [PATCH] CComponentsForm: fix possible segfault Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7fd870a0639fef0866889720b40775f4f916a307 Author: Thilo Graf Date: 2013-06-25 (Tue, 25 Jun 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 1cf9ff3ca..990a62223 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -195,10 +195,9 @@ void CComponentsForm::replaceCCItem(const uint& cc_item_id, CComponentsItem* new if (!v_cc_items.empty()){ CComponentsItem* old_Item = v_cc_items[cc_item_id]; if (old_Item){ - if (old_Item->getParent()){ - new_cc_Item->setParent(old_Item); - new_cc_Item->setIndex(old_Item->getIndex()); - } + CComponentsItem * old_parent = old_Item->getParent(); + new_cc_Item->setParent(old_parent); + new_cc_Item->setIndex(old_parent->getIndex()); delete old_Item; old_Item = NULL; v_cc_items[cc_item_id] = new_cc_Item;