Skip to content
Snippets Groups Projects
Commit ee543a83 authored by Tazpn's avatar Tazpn
Browse files

Fix iterator issue with NiNode when clearing children and Clearing issue with...

Fix iterator issue with NiNode when clearing children and Clearing issue with NiObjectNET and controllers.
parent d9f57c18
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,7 @@ void NiNode::RemoveChild( Ref<NiAVObject> obj ) {
}
void NiNode::ClearChildren() {
for ( vector< NiAVObjectRef >::iterator it = children.begin(); it != children.end(); ) {
for ( vector< NiAVObjectRef >::iterator it = children.begin(); it != children.end(); ++it) {
(*it)->SetParent(NULL);
}
children.clear();
......
......@@ -152,11 +152,11 @@ void NiObjectNET::RemoveController( Ref<NiTimeController> obj ) {
}
}
void NiObjectNET::ClearControllers() {
NiTimeControllerRef cont = controller;
while ( cont != NULL ) {
cont->SetTarget(NULL);
NiTimeControllerRef * cont = &controller;
while ( (*cont) != NULL ) {
(*cont)->SetTarget(NULL);
(*cont) = (*cont)->GetNextController();
}
controller = NULL;
}
list< Ref<NiTimeController> > NiObjectNET::GetControllers() const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment