strmbase: Avoid leaking references to the sink's peer in IVideoWindow::SetWindowForeground().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-10-08 20:02:22 -05:00 committed by Alexandre Julliard
parent cc3f73be74
commit d2b2e60ada
2 changed files with 2 additions and 5 deletions

View File

@ -2076,7 +2076,7 @@ static void test_video_window(void)
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
ref = IBaseFilter_Release(&source.filter.IBaseFilter_iface);
todo_wine ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %d.\n", ref);
DestroyWindow(our_hwnd);
}

View File

@ -658,16 +658,13 @@ HRESULT WINAPI BaseControlWindowImpl_SetWindowForeground(IVideoWindow *iface, LO
{
BaseControlWindow *window = impl_from_IVideoWindow(iface);
UINT flags = SWP_NOMOVE | SWP_NOSIZE;
IPin* pPin;
HRESULT hr;
TRACE("window %p, focus %d.\n", window, focus);
if (focus != OAFALSE && focus != OATRUE)
return E_INVALIDARG;
hr = IPin_ConnectedTo(&window->pPin->IPin_iface, &pPin);
if ((hr != S_OK) || !pPin)
if (!window->pPin->peer)
return VFW_E_NOT_CONNECTED;
if (!focus)