Fixing a stupid leak from mousewheel scrolling. r=pinkerton.

This commit is contained in:
bryner%uiuc.edu 2000-03-17 06:27:45 +00:00
parent 120e64e906
commit 52e5ffae3c
2 changed files with 8 additions and 6 deletions

View File

@ -2346,7 +2346,7 @@ nsIFrame*
nsEventStateManager::GetDocumentFrame(nsIPresContext* aPresContext)
{
nsCOMPtr<nsIPresShell> presShell;
nsIDocument* aDocument;
nsCOMPtr<nsIDocument> aDocument;
nsIFrame* aFrame;
nsIView* aView;
@ -2357,8 +2357,9 @@ nsEventStateManager::GetDocumentFrame(nsIPresContext* aPresContext)
return nsnull;
}
presShell->GetDocument(&aDocument);
presShell->GetPrimaryFrameFor(aDocument->GetRootContent(), &aFrame);
presShell->GetDocument(getter_AddRefs(aDocument));
nsCOMPtr<nsIContent> rootContent(dont_AddRef(aDocument->GetRootContent()));
presShell->GetPrimaryFrameFor(rootContent, &aFrame);
aFrame->GetView(aPresContext, &aView);
PR_LOG(MOUSEWHEEL, PR_LOG_DEBUG, ("GetDocumentFrame: got document view = %p\n", aView));

View File

@ -2346,7 +2346,7 @@ nsIFrame*
nsEventStateManager::GetDocumentFrame(nsIPresContext* aPresContext)
{
nsCOMPtr<nsIPresShell> presShell;
nsIDocument* aDocument;
nsCOMPtr<nsIDocument> aDocument;
nsIFrame* aFrame;
nsIView* aView;
@ -2357,8 +2357,9 @@ nsEventStateManager::GetDocumentFrame(nsIPresContext* aPresContext)
return nsnull;
}
presShell->GetDocument(&aDocument);
presShell->GetPrimaryFrameFor(aDocument->GetRootContent(), &aFrame);
presShell->GetDocument(getter_AddRefs(aDocument));
nsCOMPtr<nsIContent> rootContent(dont_AddRef(aDocument->GetRootContent()));
presShell->GetPrimaryFrameFor(rootContent, &aFrame);
aFrame->GetView(aPresContext, &aView);
PR_LOG(MOUSEWHEEL, PR_LOG_DEBUG, ("GetDocumentFrame: got document view = %p\n", aView));