diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-03-29 05:06:50 -0400 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 13:21:07 +0200 |
commit | e003547dc5c0f9336d95e499e0cefbd320130763 (patch) | |
tree | 07a1a5c161f0f8257eb129371c194b44cc8712e5 /toolkit/components/downloads/nsDownloadManager.cpp | |
parent | 56f837533876b08491de48f4a2cd9eb0f05c6d95 (diff) | |
download | UXP-e003547dc5c0f9336d95e499e0cefbd320130763.tar UXP-e003547dc5c0f9336d95e499e0cefbd320130763.tar.gz UXP-e003547dc5c0f9336d95e499e0cefbd320130763.tar.lz UXP-e003547dc5c0f9336d95e499e0cefbd320130763.tar.xz UXP-e003547dc5c0f9336d95e499e0cefbd320130763.zip |
Properly fix crash in nsDownloadManager when repeatedly pausing and resuming a download
This applies only to applications that do not use JSDownloads and is based on Bug 1224326
Diffstat (limited to 'toolkit/components/downloads/nsDownloadManager.cpp')
-rw-r--r-- | toolkit/components/downloads/nsDownloadManager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp index 9f43ade2c..587c1ac8a 100644 --- a/toolkit/components/downloads/nsDownloadManager.cpp +++ b/toolkit/components/downloads/nsDownloadManager.cpp @@ -1829,6 +1829,9 @@ nsDownloadManager::RetryDownload(nsDownload* dl) return rv; } + rv = NotifyDownloadRemoval(dl); + NS_ENSURE_SUCCESS(rv, rv); + // reset time and download progress dl->SetStartTime(PR_Now()); dl->SetProgressBytes(0, -1); @@ -3083,7 +3086,7 @@ nsDownload::OnStateChange(nsIWebProgress *aWebProgress, #else (void)SetState(nsIDownloadManager::DOWNLOAD_FINISHED); #endif - } else { + } else if (aStatus != NS_BINDING_ABORTED) { // We failed for some unknown reason -- fail with a generic message (void)FailDownload(aStatus, nullptr); } |