Bug 536486, remove IsDestroyingFrames check now that frames are available from content nodes, fixes possible leak, r=roc

This commit is contained in:
Neil Deakin
2009-12-31 12:36:56 -05:00
parent 8b00fffabb
commit 4d9f675da2

View File

@@ -4374,21 +4374,8 @@ PresShell::ClearMouseCapture(nsIView* aView)
if (gCaptureInfo.mContent) { if (gCaptureInfo.mContent) {
if (aView) { if (aView) {
// if a view was specified, ensure that the captured content is within // if a view was specified, ensure that the captured content is within
// this view. Get the frame for the captured content from the right // this view.
// presshell first. nsIFrame* frame = gCaptureInfo.mContent->GetPrimaryFrame();
nsIFrame* frame = nsnull;
nsIDocument* doc = gCaptureInfo.mContent->GetCurrentDoc();
if (doc) {
nsIPresShell *shell = doc->GetPrimaryShell();
if (shell) {
// not much can happen if frames are being destroyed so just return.
if (shell->FrameManager()->IsDestroyingFrames())
return;
frame = gCaptureInfo.mContent->GetPrimaryFrame();
}
}
if (frame) { if (frame) {
nsIView* view = frame->GetClosestView(); nsIView* view = frame->GetClosestView();
// if there is no view, capturing won't be handled any more, so // if there is no view, capturing won't be handled any more, so