Commit b26ed166 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shdocvw: Move more initialization code to DocHost_Init.

parent c355574d
......@@ -478,16 +478,19 @@ static const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl = {
DocHostUIHandler_GetOverrideKeyPath
};
void DocHost_Init(DocHost *This)
void DocHost_Init(DocHost *This, IDispatch *disp)
{
This->lpDocHostUIHandlerVtbl = &DocHostUIHandler2Vtbl;
This->lpOleCommandTargetVtbl = &OleCommandTargetVtbl;
This->disp = disp;
This->document = NULL;
This->hostui = NULL;
This->hwnd = NULL;
This->frame_hwnd = NULL;
This->url = NULL;
DocHost_ClientSite_Init(This);
DocHost_Frame_Init(This);
......@@ -498,4 +501,6 @@ void DocHost_Release(DocHost *This)
{
DocHost_ClientSite_Release(This);
DocHost_Events_Release(This);
SysFreeString(This->url);
}
......@@ -153,7 +153,7 @@ void WebBrowser_HlinkFrame_Init(WebBrowser*);
void WebBrowser_OleObject_Destroy(WebBrowser*);
void DocHost_Init(DocHost*);
void DocHost_Init(DocHost*,IDispatch*);
void DocHost_ClientSite_Init(DocHost*);
void DocHost_Events_Init(DocHost*);
void DocHost_Frame_Init(DocHost*);
......
......@@ -132,7 +132,6 @@ static ULONG WINAPI WebBrowser_Release(IWebBrowser2 *iface)
WebBrowser_OleObject_Destroy(This);
SysFreeString(This->doc_host.url);
HeapFree(GetProcessHeap(), 0, This);
SHDOCVW_UnlockModule();
}
......@@ -844,10 +843,7 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
ret->lpWebBrowser2Vtbl = &WebBrowser2Vtbl;
ret->ref = 0;
ret->doc_host.url = NULL;
ret->doc_host.disp = (IDispatch*)WEBBROWSER2(ret);
DocHost_Init(&ret->doc_host);
DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret));
WebBrowser_OleObject_Init(ret);
WebBrowser_ViewObject_Init(ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment