Bug 1110928, part 2 - Call PokeGC in nsDocumentViewer::PageHide before the call to OnPageHide. r=smaug
This ensures that the document isn't destroyed when we call PokeGC, which will be useful later. MozReview-Commit-ID: 4iCy0bRY2kK
This commit is contained in:
@@ -1284,6 +1284,11 @@ nsDocumentViewer::PageHide(bool aIsUnload)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (aIsUnload) {
|
||||
// Poke the GC. The window might be collectable garbage now.
|
||||
nsJSContext::PokeGC(JS::gcreason::PAGE_HIDE, NS_GC_DELAY * 2);
|
||||
}
|
||||
|
||||
mDocument->OnPageHide(!aIsUnload, nullptr);
|
||||
|
||||
// inform the window so that the focus state is reset.
|
||||
@@ -1293,10 +1298,6 @@ nsDocumentViewer::PageHide(bool aIsUnload)
|
||||
window->PageHidden();
|
||||
|
||||
if (aIsUnload) {
|
||||
// Poke the GC. The window might be collectable garbage now.
|
||||
nsJSContext::PokeGC(JS::gcreason::PAGE_HIDE, NS_GC_DELAY * 2);
|
||||
|
||||
// if Destroy() was called during OnPageHide(), mDocument is nullptr.
|
||||
NS_ENSURE_STATE(mDocument);
|
||||
|
||||
// First, get the window from the document...
|
||||
|
||||
Reference in New Issue
Block a user