Partition * Partition::AddChild() { Partition *child = new Partition(fFD); TRACE(("%p Partition::AddChild %p\n", this, child)); if (child == NULL) return NULL; child->SetParent(this); child_count++; fChildren.Add(child); return child; }
Partition::~Partition() { TRACE(("%p Partition::~Partition\n", this)); // Tell the children that their parent is gone NodeIterator iterator = gPartitions.GetIterator(); Partition *child; while ((child = (Partition *)iterator.Next()) != NULL) { if (child->Parent() == this) child->SetParent(NULL); } close(fFD); }