diff --git a/mozilla/xpfe/components/xfer/resources/downloadProgress.xul b/mozilla/xpfe/components/xfer/resources/downloadProgress.xul index 9a307a34e8c..50643854b0a 100644 --- a/mozilla/xpfe/components/xfer/resources/downloadProgress.xul +++ b/mozilla/xpfe/components/xfer/resources/downloadProgress.xul @@ -19,6 +19,7 @@ @@ -75,6 +76,11 @@ data.execute.setAttribute("command","start"); } + function onUnload() { + // Inform underlying C++ object. + data.execute.setAttribute("command","unload"); + } + var started = false; var completed = false; var startTime; @@ -176,6 +182,8 @@ } + + @@ -236,4 +244,6 @@ + + diff --git a/mozilla/xpfe/components/xfer/src/nsDownloadProgressDialog.cpp b/mozilla/xpfe/components/xfer/src/nsDownloadProgressDialog.cpp index f90b9607031..e48d88d5f08 100644 --- a/mozilla/xpfe/components/xfer/src/nsDownloadProgressDialog.cpp +++ b/mozilla/xpfe/components/xfer/src/nsDownloadProgressDialog.cpp @@ -57,6 +57,12 @@ nsDownloadProgressDialog::OnClose() { } } +void +nsDownloadProgressDialog::OnUnload() { + // Window was closed (or is closing), release it. + mWindow = 0; +} + void nsDownloadProgressDialog::OnStart() { // Load source stream into file. @@ -361,6 +367,8 @@ nsDownloadProgressDialog::AttributeChanged( nsIDocument *aDocument, OnStop(); } else if ( cmd == "close" ) { OnClose(); + } else if ( cmd == "unload" ) { + OnUnload(); } else { } } diff --git a/mozilla/xpfe/components/xfer/src/nsDownloadProgressDialog.h b/mozilla/xpfe/components/xfer/src/nsDownloadProgressDialog.h index 094a98e9f78..c221ec1fe0b 100644 --- a/mozilla/xpfe/components/xfer/src/nsDownloadProgressDialog.h +++ b/mozilla/xpfe/components/xfer/src/nsDownloadProgressDialog.h @@ -131,6 +131,7 @@ protected: void OnClose(); void OnStart(); void OnStop(); + void OnUnload(); private: nsCOMPtr mUrl;