| 1144 | } |
| 1145 | |
| 1146 | void Node::resetChild(Node* child, bool cleanup) |
| 1147 | { // IMPORTANT: |
| 1148 | // -1st do onExit |
| 1149 | // -2nd cleanup |
| 1150 | if (_running) |
| 1151 | { |
| 1152 | child->onExitTransitionDidStart(); |
| 1153 | child->onExit(); |
| 1154 | } |
| 1155 | |
| 1156 | // If you don't do cleanup, the child's actions will not get removed and the |
| 1157 | // its scheduledSelectors_ dict will not get released! |
| 1158 | if (cleanup) |
| 1159 | { |
| 1160 | child->cleanup(); |
| 1161 | } |
| 1162 | |
| 1163 | #if AX_ENABLE_GC_FOR_NATIVE_OBJECTS |
| 1164 | auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); |
| 1165 | if (sEngine) |
| 1166 | { |
| 1167 | sEngine->releaseScriptObject(this, child); |
| 1168 | } |
| 1169 | #endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS |
| 1170 | // set parent nil at the end |
| 1171 | child->setParent(nullptr); |
| 1172 | } |
| 1173 | |
| 1174 | void Node::detachChild(Node* child, ssize_t childIndex, bool cleanup) |
| 1175 | { |
no test coverage detected