Commit 10f35222 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

ieframe: Don't release the advise sink in IOleObject::SetClientSite.

parent b53c5b30
......@@ -311,11 +311,6 @@ static void release_client_site(WebBrowser *This)
IOleInPlaceUIWindow_Release(This->uiwindow);
This->uiwindow = NULL;
}
if(This->sink) {
IAdviseSink_Release(This->sink);
This->sink = NULL;
}
}
typedef struct {
......
......@@ -4003,6 +4003,7 @@ static void test_SetAdvise(void)
IWebBrowser2 *browser;
IViewObject2 *view;
IAdviseSink *sink;
IOleObject *oleobj;
DWORD aspects, flags;
if (!(browser = create_webbrowser())) return;
......@@ -4031,9 +4032,38 @@ static void test_SetAdvise(void)
ok(!flags, "got %08x\n", aspects);
ok(sink == &test_sink, "got %p\n", sink);
hr = IWebBrowser2_QueryInterface(browser, &IID_IOleObject, (void **)&oleobj);
ok(hr == S_OK, "got %08x\n", hr);
SET_EXPECT(GetContainer);
SET_EXPECT(Site_GetWindow);
SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
SET_EXPECT(Invoke_AMBIENT_SILENT);
hr = IOleObject_SetClientSite(oleobj, &ClientSite);
ok(hr == S_OK, "got %08x\n", hr);
CHECK_CALLED(GetContainer);
CHECK_CALLED(Site_GetWindow);
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(Invoke_AMBIENT_SILENT);
sink = (IAdviseSink *)0xdeadbeef;
hr = IViewObject2_GetAdvise(view, &aspects, &flags, &sink);
ok(hr == S_OK, "got %08x\n", hr);
ok(sink == &test_sink, "got %p\n", sink);
hr = IOleObject_SetClientSite(oleobj, NULL);
ok(hr == S_OK, "got %08x\n", hr);
aspects = flags = 0xdeadbeef;
sink = (IAdviseSink *)0xdeadbeef;
hr = IViewObject2_GetAdvise(view, &aspects, &flags, &sink);
ok(hr == S_OK, "got %08x\n", hr);
ok(sink == &test_sink, "got %p\n", sink);
hr = IViewObject2_SetAdvise(view, 0, 0, NULL);
ok(hr == S_OK, "got %08x\n", hr);
IOleObject_Release(oleobj);
IViewObject2_Release(view);
IWebBrowser2_Release(browser);
}
......
......@@ -167,6 +167,9 @@ static ULONG WINAPI WebBrowser_Release(IWebBrowser2 *iface)
TRACE("(%p) ref=%d\n", This, ref);
if(!ref) {
if(This->sink)
IAdviseSink_Release(This->sink);
if(This->doc_host.document)
IUnknown_Release(This->doc_host.document);
......
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