MCPcopy Create free account
hub / github.com/axmolengine/axmol / resetChild

Method resetChild

core/2d/Node.cpp:1146–1172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1144}
1145
1146void 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
1174void Node::detachChild(Node* child, ssize_t childIndex, bool cleanup)
1175{

Callers 1

appendChildMethod · 0.80

Calls 5

getInstanceFunction · 0.85
onExitMethod · 0.45
cleanupMethod · 0.45
setParentMethod · 0.45

Tested by

no test coverage detected