UIWidget::~UIWidget() { releaseResoures(); setParent(NULL); m_pLayoutParameterDictionary->removeAllObjects(); CC_SAFE_RELEASE(m_pLayoutParameterDictionary); CC_SAFE_RELEASE(m_pScheduler); }
void UIWidget::removeFromParentAndCleanup(bool cleanup) { if (m_pWidgetParent) { m_pWidgetParent->removeChild(this, cleanup); } else { structureChangedEvent(); releaseResoures(); m_pWidgetParent = NULL; delete this; } }