From 54d82d80d738cddb95f925189b8937e37a1a85c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 15 Jan 2020 00:14:37 -0600 Subject: [PATCH] strmbase: Detach the window from the parent before destroying it. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a regression introduced by 3b5198c8283d891095612c1001edb5e5788d6059. Signed-off-by: Gabriel Ivăncescu Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/strmbase/window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/strmbase/window.c b/dlls/strmbase/window.c index 07a12eca26b..963c7f2b027 100644 --- a/dlls/strmbase/window.c +++ b/dlls/strmbase/window.c @@ -136,9 +136,15 @@ HRESULT WINAPI BaseWindowImpl_PrepareWindow(BaseWindow *This) HRESULT WINAPI BaseWindowImpl_DoneWithWindow(BaseWindow *This) { + BaseControlWindow *window = impl_from_BaseWindow(This); + if (!This->hWnd) return S_OK; + /* Media Player Classic deadlocks if WM_PARENTNOTIFY is sent, so unparent + * the window first. */ + IVideoWindow_put_Owner(&window->IVideoWindow_iface, 0); + SendMessageW(This->hWnd, WM_CLOSE, 0, 0); This->hWnd = NULL;