Jacek Caban : shdocvw: Abort pending navigation task when adding a new one.

Alexandre Julliard julliard at winehq.org
Thu May 26 10:56:29 CDT 2011


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu May 26 17:02:03 2011 +0200

shdocvw: Abort pending navigation task when adding a new one.

---

 dlls/shdocvw/dochost.c  |    7 +++++--
 dlls/shdocvw/navigate.c |    1 +
 dlls/shdocvw/shdocvw.h  |    1 +
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/shdocvw/dochost.c b/dlls/shdocvw/dochost.c
index 97e5f77..2ab7975 100644
--- a/dlls/shdocvw/dochost.c
+++ b/dlls/shdocvw/dochost.c
@@ -62,11 +62,14 @@ LRESULT process_dochost_tasks(DocHost *This)
     return 0;
 }
 
-static void abort_dochost_tasks(DocHost *This)
+void abort_dochost_tasks(DocHost *This, task_proc_t proc)
 {
     task_header_t *task, *cursor;
 
     LIST_FOR_EACH_ENTRY_SAFE(task, cursor, &This->task_queue, task_header_t, entry) {
+        if(proc && proc != task->proc)
+            continue;
+
         list_remove(&task->entry);
         task->destr(task);
     }
@@ -886,7 +889,7 @@ void DocHost_Init(DocHost *This, IDispatch *disp, const IDocHostContainerVtbl* c
 
 void DocHost_Release(DocHost *This)
 {
-    abort_dochost_tasks(This);
+    abort_dochost_tasks(This, NULL);
     release_dochost_client(This);
     DocHost_ClientSite_Release(This);
 
diff --git a/dlls/shdocvw/navigate.c b/dlls/shdocvw/navigate.c
index 32af0f1..1f8e6a4 100644
--- a/dlls/shdocvw/navigate.c
+++ b/dlls/shdocvw/navigate.c
@@ -761,6 +761,7 @@ static HRESULT async_doc_navigate(DocHost *This, LPCWSTR url, LPCWSTR headers, P
     }
 
     task->async_notif = async_notif;
+    abort_dochost_tasks(This, doc_navigate_proc);
     push_dochost_task(This, &task->header, doc_navigate_proc, doc_navigate_task_destr, FALSE);
     return S_OK;
 }
diff --git a/dlls/shdocvw/shdocvw.h b/dlls/shdocvw/shdocvw.h
index b127ec3..8d82417 100644
--- a/dlls/shdocvw/shdocvw.h
+++ b/dlls/shdocvw/shdocvw.h
@@ -251,6 +251,7 @@ void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDE
 #define WM_DOCHOSTTASK (WM_USER+0x300)
 void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL) DECLSPEC_HIDDEN;
 LRESULT  process_dochost_tasks(DocHost*) DECLSPEC_HIDDEN;
+void abort_dochost_tasks(DocHost*,task_proc_t) DECLSPEC_HIDDEN;
 
 HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
 void InternetExplorer_WebBrowser_Init(InternetExplorer*) DECLSPEC_HIDDEN;




More information about the wine-cvs mailing list