aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/MozDownload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'embed/mozilla/MozDownload.cpp')
-rw-r--r--embed/mozilla/MozDownload.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index 11978a8bb..b2b7e0e2e 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -369,7 +369,9 @@ MozDownload::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aRequest,
}
/* We will get this even in the event of a cancel */
- if (aStateFlags & STATE_STOP)
+ /* Be careful that download is only completed when STATE_IS_NETWORK is set
+ and many lonely STOP events may be triggered before */
+ if ((aStateFlags & STATE_STOP) && (aStateFlags & STATE_IS_NETWORK))
{
/* Keep us alive */
nsCOMPtr<nsITransfer> kungFuDeathGrip(this);