From 9f39f8a12ea1b910ae3303f3ef38d6216171ec88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Rameau?= Date: Wed, 10 Aug 2005 16:27:46 +0000 Subject: Gecko send several STATE_STOP, but only the final one (completed) is of MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2005-08-10 Jean-François Rameau * embed/mozilla/MozDownload.cpp (OnStateChange): Gecko send several STATE_STOP, but only the final one (completed) is of interest (STATE_STOP&STATE_IS_NETWORK). Fix crash with gecko 1.8 when downloading. * embed/mozilla/mozilla-embed.cpp: Fix compilation warning. --- embed/mozilla/MozDownload.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'embed/mozilla/MozDownload.cpp') 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 kungFuDeathGrip(this); -- cgit v1.2.3