Commit d2b2e60a authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

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

parent cc3f73be
......@@ -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);
}
......
......@@ -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)
......
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