mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-19 09:30:44 +00:00
added deathgrip to survive window destruction during onload handler. part of fix for bug 19302. r:hyatt a:chofmann
This commit is contained in:
parent
90f941f8fe
commit
6ad070506f
@ -3014,6 +3014,11 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
/* one of many safeguards that prevent death and destruction if
|
||||
someone is so very very rude as to bring this window down
|
||||
during this load handler. */
|
||||
nsCOMPtr<nsIWebShell> kungFuDeathGrip(this);
|
||||
|
||||
//if (!mProcessedEndDocumentLoad) {
|
||||
if (loader == mDocLoader) {
|
||||
mProcessedEndDocumentLoad = PR_TRUE;
|
||||
|
@ -960,6 +960,11 @@ void nsDocLoaderImpl::DocLoaderIsEmpty(nsresult aStatus)
|
||||
{
|
||||
if (mIsLoadingDocument) {
|
||||
PRBool busy = PR_FALSE;
|
||||
/* In the unimagineably rude circumstance that onload event handlers
|
||||
triggered by this function actually kill the window ... ok, it's
|
||||
not unimagineable; it's happened ... this deathgrip keeps this object
|
||||
alive long enough to survive this function call. */
|
||||
nsCOMPtr<nsIDocumentLoader> kungFuDeathGrip(this);
|
||||
|
||||
IsBusy(busy);
|
||||
if (!busy) {
|
||||
|
@ -960,6 +960,11 @@ void nsDocLoaderImpl::DocLoaderIsEmpty(nsresult aStatus)
|
||||
{
|
||||
if (mIsLoadingDocument) {
|
||||
PRBool busy = PR_FALSE;
|
||||
/* In the unimagineably rude circumstance that onload event handlers
|
||||
triggered by this function actually kill the window ... ok, it's
|
||||
not unimagineable; it's happened ... this deathgrip keeps this object
|
||||
alive long enough to survive this function call. */
|
||||
nsCOMPtr<nsIDocumentLoader> kungFuDeathGrip(this);
|
||||
|
||||
IsBusy(busy);
|
||||
if (!busy) {
|
||||
|
@ -3014,6 +3014,11 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
/* one of many safeguards that prevent death and destruction if
|
||||
someone is so very very rude as to bring this window down
|
||||
during this load handler. */
|
||||
nsCOMPtr<nsIWebShell> kungFuDeathGrip(this);
|
||||
|
||||
//if (!mProcessedEndDocumentLoad) {
|
||||
if (loader == mDocLoader) {
|
||||
mProcessedEndDocumentLoad = PR_TRUE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user