mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 521608 - nsCanvasRenderingContext2D::GetPresShell may crash or leak, r=vlad, sr=jst
This commit is contained in:
parent
8b68dba6c0
commit
572d40007e
@ -488,14 +488,17 @@ protected:
|
||||
* Gets the pres shell from either the canvas element or the doc shell
|
||||
*/
|
||||
nsIPresShell *GetPresShell() {
|
||||
nsIPresShell *presShell = nsnull;
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(mCanvasElement);
|
||||
if (content) {
|
||||
presShell = content->GetOwnerDoc()->GetPrimaryShell();
|
||||
} else if (mDocShell) {
|
||||
mDocShell->GetPresShell(&presShell);
|
||||
nsIDocument* ownerDoc = content->GetOwnerDoc();
|
||||
return ownerDoc ? ownerDoc->GetPrimaryShell() : nsnull;
|
||||
}
|
||||
return presShell;
|
||||
if (mDocShell) {
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
mDocShell->GetPresShell(getter_AddRefs(shell));
|
||||
return shell.get();
|
||||
}
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
// text
|
||||
|
Loading…
Reference in New Issue
Block a user