Module: wine Branch: master Commit: d2b2e60ada6e6f5b1f90ceaa887a68737830a8bb URL: https://source.winehq.org/git/wine.git/?a=commit;h=d2b2e60ada6e6f5b1f90ceaa8... Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Oct 8 20:02:22 2019 -0500 strmbase: Avoid leaking references to the sink's peer in IVideoWindow::SetWindowForeground(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/videorenderer.c | 2 +- dlls/strmbase/window.c | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index c851146af7..69bbc57949 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -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); } diff --git a/dlls/strmbase/window.c b/dlls/strmbase/window.c index 9a91586783..7f4dd40248 100644 --- a/dlls/strmbase/window.c +++ b/dlls/strmbase/window.c @@ -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)