Exemple #1
0
void wyNode::removeAllChildren(bool cleanup) {
    // if child list is locked, means something is happening
    if(m_children->locked || m_childrenChanging)
        return;
    m_childrenChanging = true;

    for(int i = 0; i < m_children->num; i++) {
        wyNode* child = (wyNode*)wyArrayGet(m_children, i);

        child->onDetachFromParent(this);

        if(m_running)
            child->onExit();

        if(cleanup)
            child->cleanup();

        child->m_parent = NULL;
        wyObjectRelease(child);
    }
    wyArrayClear(m_children);

    // reset flag
    m_childrenChanging = false;
}
Exemple #2
0
void wyPageControl::removeAllPages() {
	for(int i = 0; i < m_pages->num; i++) {
		wyNode* page = (wyNode*)wyArrayGet(m_pages, i);
		m_container->removeChildLocked(page, true);
	}
	wyArrayEach(m_pages, releasePage, NULL);
	wyArrayClear(m_pages);

	// notify indicator
	if(m_indicator)
		m_indicator->onPageAllRemoved();
}
Exemple #3
0
void wyNode::cleanup() {
    // stop all actions
    stopAllActions(false);

    // clear selectors
    if(m_timers != NULL) {
        wyArrayEach(m_timers, releaseTimer, NULL);
        wyArrayClear(m_timers);
    }

    // cleanup children
    wyArrayEach(m_children, sCleanup, NULL);
}
Exemple #4
0
wyAStarTile::~wyAStarTile() {
    wyArrayClear( m_childs);
    wyArrayDestroy(m_childs);
    m_childs = NULL;
}