THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/10/2005 at 04:59, xxxxxxxx wrote:
Cinema 4D Version: 9.1
Language(s) : C++ ;
I need a way to remove all the children of a BaseObject
This is what I currently have
void RemoveChildObjects(BaseObject* op)
BaseObject *child = op->GetDown();
But that doesn't work because child becomes NULL after the first BaseObject::Free
On 30/10/2005 at 05:13, xxxxxxxx wrote:
get the child before you remove the original.
temp = child->GetNext();
child = temp;
On 30/10/2005 at 06:49, xxxxxxxx wrote:
why did I think of that
On 30/10/2005 at 12:40, xxxxxxxx wrote:
I have a question indirect to this discussion. Every time that I Remove() something from a document and try to Free() it, Cinema 4D crashes (Objects, Tags, Materials, you name it). I have since determined that either Cinema 4D handles the deallocation or it is also possible that as long as the object is tied to an Undo, it cannot be deleted (thereafter handled by Cinema 4D). I always add AddUndo(UNDO_NEW) when inserting just-created objects. Could this be why I can't Remove()-Free()?
On 01/11/2005 at 06:21, xxxxxxxx wrote:
I don´t think it could be the cause for the crashing. Maybe another plugin is the cause? Try to remove all other plugins, this may help sometimes. Otherwise I don´t see a reason for crashing with Remove & Free(). Never has this issue.