Logo Search packages:      
Sourcecode: xulrunner version File versions  Download package

void nsGenericElement::DestroyContent (  )  [virtual, inherited]

Destroy this node and its children. Ideally this shouldn't be needed but for now we need to do it to break cycles.

Implements nsIContent.

Reimplemented in nsGenericHTMLFrameElement.

Definition at line 3446 of file nsGenericElement.cpp.

References nsINode::GetOwnerDoc(), and nsGenericElement::mAttrsAndChildren.

{
  nsIDocument *document = GetOwnerDoc();
  if (document) {
    document->BindingManager()->ChangeDocumentFor(this, document, nsnull);
    document->ClearBoxObjectFor(this);
  }

  // XXX We really should let cycle collection do this, but that currently still
  //     leaks (see https://bugzilla.mozilla.org/show_bug.cgi?id=406684).
  nsContentUtils::ReleaseWrapper(this, this);

  PRUint32 i, count = mAttrsAndChildren.ChildCount();
  for (i = 0; i < count; ++i) {
    // The child can remove itself from the parent in BindToTree.
    mAttrsAndChildren.ChildAt(i)->DestroyContent();
  }
}


Generated by  Doxygen 1.6.0   Back to index