зеркало из https://github.com/mozilla/gecko-dev.git
Bug 521608 - nsCanvasRenderingContext2D::GetPresShell may crash or leak, r=vlad, sr=jst
This commit is contained in:
Родитель
491475514e
Коммит
804758d645
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче