Jacek Caban : shdocvw: Moved DocHost client site releasing to separated function and release more interfaces in SetClientSite .
Alexandre Julliard
julliard at winehq.org
Mon Jan 25 11:21:01 CST 2010
Module: wine
Branch: master
Commit: 8112b59c9e2f134eaee90653631b7e987f8ec312
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8112b59c9e2f134eaee90653631b7e987f8ec312
Author: Jacek Caban <jacek at codeweavers.com>
Date: Fri Jan 22 17:12:26 2010 +0100
shdocvw: Moved DocHost client site releasing to separated function and release more interfaces in SetClientSite.
---
dlls/shdocvw/dochost.c | 29 ++++++++++++++++++++++++-----
dlls/shdocvw/oleobject.c | 11 ++---------
dlls/shdocvw/shdocvw.h | 1 +
3 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/dlls/shdocvw/dochost.c b/dlls/shdocvw/dochost.c
index 5d661fd..6c9d05c 100644
--- a/dlls/shdocvw/dochost.c
+++ b/dlls/shdocvw/dochost.c
@@ -362,6 +362,29 @@ void deactivate_document(DocHost *This)
This->document = NULL;
}
+void release_dochost_client(DocHost *This)
+{
+ if(This->hwnd) {
+ DestroyWindow(This->hwnd);
+ This->hwnd = NULL;
+ }
+
+ if(This->hostui) {
+ IDocHostUIHandler_Release(This->hostui);
+ This->hostui = NULL;
+ }
+
+ if(This->client_disp) {
+ IDispatch_Release(This->client_disp);
+ This->client_disp = NULL;
+ }
+
+ if(This->frame) {
+ IOleInPlaceFrame_Release(This->frame);
+ This->frame = NULL;
+ }
+}
+
#define OLECMD_THIS(iface) DEFINE_THIS(DocHost, OleCommandTarget, iface)
static HRESULT WINAPI ClOleCommandTarget_QueryInterface(IOleCommandTarget *iface,
@@ -744,11 +767,7 @@ void DocHost_Init(DocHost *This, IDispatch *disp)
void DocHost_Release(DocHost *This)
{
- if(This->client_disp)
- IDispatch_Release(This->client_disp);
- if(This->frame)
- IOleInPlaceFrame_Release(This->frame);
-
+ release_dochost_client(This);
DocHost_ClientSite_Release(This);
ConnectionPointContainer_Destroy(&This->cps);
diff --git a/dlls/shdocvw/oleobject.c b/dlls/shdocvw/oleobject.c
index dde850f..573e60d 100644
--- a/dlls/shdocvw/oleobject.c
+++ b/dlls/shdocvw/oleobject.c
@@ -292,10 +292,8 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
if(This->client == pClientSite)
return S_OK;
- if(This->doc_host.hwnd) {
- DestroyWindow(This->doc_host.hwnd);
- This->doc_host.hwnd = NULL;
- }
+ release_dochost_client(&This->doc_host);
+
if(This->shell_embedding_hwnd) {
DestroyWindow(This->shell_embedding_hwnd);
This->shell_embedding_hwnd = NULL;
@@ -306,11 +304,6 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
This->inplace = NULL;
}
- if(This->doc_host.hostui) {
- IDocHostUIHandler_Release(This->doc_host.hostui);
- This->doc_host.hostui = NULL;
- }
-
if(This->client)
IOleClientSite_Release(This->client);
diff --git a/dlls/shdocvw/shdocvw.h b/dlls/shdocvw/shdocvw.h
index 8d0861f..c5b9c9a 100644
--- a/dlls/shdocvw/shdocvw.h
+++ b/dlls/shdocvw/shdocvw.h
@@ -205,6 +205,7 @@ void WebBrowser_OleObject_Destroy(WebBrowser*);
void DocHost_Init(DocHost*,IDispatch*);
void DocHost_ClientSite_Init(DocHost*);
void DocHost_Frame_Init(DocHost*);
+void release_dochost_client(DocHost*);
void DocHost_Release(DocHost*);
void DocHost_ClientSite_Release(DocHost*);
More information about the wine-cvs
mailing list