diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-03-29 05:06:50 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-03-29 05:07:36 -0400 |
commit | 61d3be47459f5edf9cee7593da6475263ef30721 (patch) | |
tree | 6ed068df50e74262fe211b23dc5c51994c87e43b /toolkit/components/downloads | |
parent | 0750e2d3c9075bc5cadc0a706e667acda041dd5b (diff) | |
download | uxp-61d3be47459f5edf9cee7593da6475263ef30721.tar.gz |
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')
-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 9f43ade2c4..587c1ac8ab 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); } |