Jacek Caban : mshtml: Remove old channel from load group in nsIAsyncVerifyRedirectCallback:: AsyncOnChannelRedirect.

Alexandre Julliard julliard at winehq.org
Thu Apr 5 12:31:46 CDT 2012


Module: wine
Branch: master
Commit: 5fad02d0f16ce74ddc98af5eedb09d8be52435b0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5fad02d0f16ce74ddc98af5eedb09d8be52435b0

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Apr  5 13:57:26 2012 +0200

mshtml: Remove old channel from load group in nsIAsyncVerifyRedirectCallback::AsyncOnChannelRedirect.

---

 dlls/mshtml/navigate.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c
index 1255121..2c6d826 100644
--- a/dlls/mshtml/navigate.c
+++ b/dlls/mshtml/navigate.c
@@ -1200,17 +1200,16 @@ static nsrefcnt NSAPI nsAsyncVerifyRedirectCallback_Release(nsIAsyncVerifyRedire
 static nsresult NSAPI nsAsyncVerifyRedirectCallback_AsyncOnChannelRedirect(nsIAsyncVerifyRedirectCallback *iface, nsresult result)
 {
     nsRedirectCallback *This = impl_from_nsIAsyncVerifyRedirectCallback(iface);
+    nsChannel *old_nschannel;
+    nsresult nsres;
 
     TRACE("(%p)->(%08x)\n", This, result);
 
-    if(This->bsc->nschannel)
-        nsIHttpChannel_Release(&This->bsc->nschannel->nsIHttpChannel_iface);
+    old_nschannel = This->bsc->nschannel;
     nsIChannel_AddRef(&This->nschannel->nsIHttpChannel_iface);
     This->bsc->nschannel = This->nschannel;
 
     if(This->nschannel->load_group) {
-        nsresult nsres;
-
         nsres = nsILoadGroup_AddRequest(This->nschannel->load_group, (nsIRequest*)&This->nschannel->nsIHttpChannel_iface,
                 NULL);
         if(NS_FAILED(nsres))
@@ -1228,6 +1227,14 @@ static nsresult NSAPI nsAsyncVerifyRedirectCallback_AsyncOnChannelRedirect(nsIAs
         }
     }
 
+    if(old_nschannel) {
+        nsres = nsILoadGroup_RemoveRequest(old_nschannel->load_group,
+                (nsIRequest*)&old_nschannel->nsIHttpChannel_iface, NULL, NS_OK);
+        if(NS_FAILED(nsres))
+            ERR("RemoveRequest failed: %08x\n", nsres);
+        nsIHttpChannel_Release(&old_nschannel->nsIHttpChannel_iface);
+    }
+
     return NS_OK;
 }
 
@@ -1480,6 +1487,8 @@ static HRESULT handle_redirect(nsChannelBSC *This, const WCHAR *new_url)
 
     hres = create_redirect_nschannel(new_url, This->nschannel, &new_channel);
     if(SUCCEEDED(hres)) {
+        TRACE("%p %p->%p\n", This, This->nschannel, new_channel);
+
         hres = create_redirect_callback(new_channel, This, &callback);
         nsIChannel_Release(&new_channel->nsIHttpChannel_iface);
     }




More information about the wine-cvs mailing list