shdocvw: Move more initialization code to DocHost_Init.
This commit is contained in:
parent
c355574d4f
commit
b26ed16633
@ -478,16 +478,19 @@ static const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl = {
|
|||||||
DocHostUIHandler_GetOverrideKeyPath
|
DocHostUIHandler_GetOverrideKeyPath
|
||||||
};
|
};
|
||||||
|
|
||||||
void DocHost_Init(DocHost *This)
|
void DocHost_Init(DocHost *This, IDispatch *disp)
|
||||||
{
|
{
|
||||||
This->lpDocHostUIHandlerVtbl = &DocHostUIHandler2Vtbl;
|
This->lpDocHostUIHandlerVtbl = &DocHostUIHandler2Vtbl;
|
||||||
This->lpOleCommandTargetVtbl = &OleCommandTargetVtbl;
|
This->lpOleCommandTargetVtbl = &OleCommandTargetVtbl;
|
||||||
|
|
||||||
|
This->disp = disp;
|
||||||
|
|
||||||
This->document = NULL;
|
This->document = NULL;
|
||||||
This->hostui = NULL;
|
This->hostui = NULL;
|
||||||
|
|
||||||
This->hwnd = NULL;
|
This->hwnd = NULL;
|
||||||
This->frame_hwnd = NULL;
|
This->frame_hwnd = NULL;
|
||||||
|
This->url = NULL;
|
||||||
|
|
||||||
DocHost_ClientSite_Init(This);
|
DocHost_ClientSite_Init(This);
|
||||||
DocHost_Frame_Init(This);
|
DocHost_Frame_Init(This);
|
||||||
@ -498,4 +501,6 @@ void DocHost_Release(DocHost *This)
|
|||||||
{
|
{
|
||||||
DocHost_ClientSite_Release(This);
|
DocHost_ClientSite_Release(This);
|
||||||
DocHost_Events_Release(This);
|
DocHost_Events_Release(This);
|
||||||
|
|
||||||
|
SysFreeString(This->url);
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ void WebBrowser_HlinkFrame_Init(WebBrowser*);
|
|||||||
|
|
||||||
void WebBrowser_OleObject_Destroy(WebBrowser*);
|
void WebBrowser_OleObject_Destroy(WebBrowser*);
|
||||||
|
|
||||||
void DocHost_Init(DocHost*);
|
void DocHost_Init(DocHost*,IDispatch*);
|
||||||
void DocHost_ClientSite_Init(DocHost*);
|
void DocHost_ClientSite_Init(DocHost*);
|
||||||
void DocHost_Events_Init(DocHost*);
|
void DocHost_Events_Init(DocHost*);
|
||||||
void DocHost_Frame_Init(DocHost*);
|
void DocHost_Frame_Init(DocHost*);
|
||||||
|
@ -132,7 +132,6 @@ static ULONG WINAPI WebBrowser_Release(IWebBrowser2 *iface)
|
|||||||
|
|
||||||
WebBrowser_OleObject_Destroy(This);
|
WebBrowser_OleObject_Destroy(This);
|
||||||
|
|
||||||
SysFreeString(This->doc_host.url);
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
SHDOCVW_UnlockModule();
|
SHDOCVW_UnlockModule();
|
||||||
}
|
}
|
||||||
@ -844,10 +843,7 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
|
|||||||
ret->lpWebBrowser2Vtbl = &WebBrowser2Vtbl;
|
ret->lpWebBrowser2Vtbl = &WebBrowser2Vtbl;
|
||||||
ret->ref = 0;
|
ret->ref = 0;
|
||||||
|
|
||||||
ret->doc_host.url = NULL;
|
DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret));
|
||||||
|
|
||||||
ret->doc_host.disp = (IDispatch*)WEBBROWSER2(ret);
|
|
||||||
DocHost_Init(&ret->doc_host);
|
|
||||||
|
|
||||||
WebBrowser_OleObject_Init(ret);
|
WebBrowser_OleObject_Init(ret);
|
||||||
WebBrowser_ViewObject_Init(ret);
|
WebBrowser_ViewObject_Init(ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user