private void detachChild(CCNode child, bool doCleanup) { if (this.m_bIsRunning) { child.onExit(); } if (doCleanup) { child.cleanup(); } child.parent = null; this.m_pChildren.Remove(child); }
private void detachChild(CCNode child, bool doCleanup) { // IMPORTANT: // -1st do onExit // -2nd cleanup if (m_bIsRunning) { child.onExit(); } // If you don't do cleanup, the child's actions will not get removed and the // its scheduledSelectors_ dict will not get released! if (doCleanup) { child.cleanup(); } // set parent nil at the end child.parent = null; m_pChildren.Remove(child); }