[vlc-devel] [PATCH] win32:vout_window: remove uneeded DestroyWindow

Steve Lhomme robux4 at ycbcr.xyz
Tue Feb 4 14:57:05 CET 2020


The WM_CLOSE posted just above will call DestroyWindow in the event-loop thread.
https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-close

Also DestroyWindow should be called from the thread that created the HWND, which
is the EventThread, not the thread with the Open/Close.
See remarks in https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroywindow
---
 modules/video_output/win32/window.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/modules/video_output/win32/window.c b/modules/video_output/win32/window.c
index 7a91c5dc05d..e53380de329 100644
--- a/modules/video_output/win32/window.c
+++ b/modules/video_output/win32/window.c
@@ -493,8 +493,6 @@ static void Close(vout_window_t *wnd)
             vlc_cond_wait( &sys->wait, &sys->lock );
         }
         vlc_mutex_unlock( &sys->lock );
-
-        DestroyWindow( sys->hwnd );
     }
     vlc_join(sys->thread, NULL);
     vlc_mutex_destroy( &sys->lock );
-- 
2.17.1



More information about the vlc-devel mailing list