зеркало из https://github.com/mozilla/pjs.git
fixes bug 325948 "crash quiting application while a download is in progress" r=mconnor
This commit is contained in:
Родитель
d9c10a953d
Коммит
9060693865
|
@ -66,6 +66,7 @@
|
|||
#include "nsIFileURL.h"
|
||||
#include "nsEmbedCID.h"
|
||||
#include "nsInt64.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
/* Outstanding issues/todo:
|
||||
* 1. Implement pause/resume.
|
||||
|
@ -709,7 +710,10 @@ nsDownloadManager::CancelDownload(const PRUnichar* aPath)
|
|||
if (!mCurrDownloads.Exists(&key))
|
||||
return RemoveDownload(aPath); // XXXBlake for now, to provide a workaround for stuck downloads
|
||||
|
||||
nsDownload* internalDownload = NS_STATIC_CAST(nsDownload*, mCurrDownloads.Get(&key));
|
||||
// Take a strong reference to the download object as we may remove it from
|
||||
// mCurrDownloads in DownloadEnded.
|
||||
nsRefPtr<nsDownload> internalDownload =
|
||||
NS_STATIC_CAST(nsDownload*, mCurrDownloads.Get(&key));
|
||||
if (!internalDownload)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
@ -1811,8 +1815,8 @@ nsDownload::nsDownload():mDownloadState(nsIDownloadManager::DOWNLOAD_NOTSTARTED)
|
|||
mCurrBytes(LL_ZERO),
|
||||
mMaxBytes(LL_ZERO),
|
||||
mStartTime(LL_ZERO),
|
||||
mSpeed(0),
|
||||
mLastUpdate(PR_Now() - (PRUint32)gInterval)
|
||||
mLastUpdate(PR_Now() - (PRUint32)gInterval),
|
||||
mSpeed(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче