nsCOMPtr<nsIDOMWindow> win(do_GetInterface(mDocShell)); nsCOMPtr<nsPIDOMWindow> win_private(do_QueryInterface(win)); if (win_private) { win_private->SetFrameElementInternal(nsnull); }
nsFrameLoader::Destroy(){  if (mOwnerContent) {    nsCOMPtr<nsIDocument> doc = mOwnerContent->GetDocument();    if (doc) {      doc->SetSubDocumentFor(mOwnerContent, nsnull);    }    mOwnerContent = nsnull;  }  nsCOMPtr<nsIBaseWindow> base_win(do_QueryInterface(mDocShell));  if (base_win) {    base_win->Destroy();  }  mDocShell = nsnull;  return NS_OK;}