OpenWindow 'gracefully' handles disconnected parent windows. bug 78504 r=dr,hyatt a=asa

git-svn-id: svn://10.0.0.236/trunk@96988 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
danm%netscape.com 2001-06-12 23:05:17 +00:00
parent 533c057d2f
commit 0740dd460d

View File

@ -508,9 +508,15 @@ nsWindowWatcher::OpenWindowJS(nsIDOMWindow *aParent,
GetWindowTreeItem(aParent, getter_AddRefs(shelltree));
if (shelltree)
shelltree->GetSameTypeRootTreeItem(getter_AddRefs(newDocShellItem));
} else
parentTreeOwner->FindItemWithName(name.GetUnicode(), nsnull,
getter_AddRefs(newDocShellItem));
} else {
/* parent is being simultaneously torn down (probably because of
the code that keeps an old docshell alive but disconnected while
we load a new one). not much to do but open the new window
without a parent. */
if (parentTreeOwner)
parentTreeOwner->FindItemWithName(name.GetUnicode(), nsnull,
getter_AddRefs(newDocShellItem));
}
} else
FindItemWithName(name.GetUnicode(), getter_AddRefs(newDocShellItem));
}