From 1a98face84f10d5fab4e644c6a6b05a5fd31d8d1 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 21 May 2015 15:30:34 -0400 Subject: [PATCH] gl: win32: do not call SetParent in release_parent_win_id() When called from gst_gl_window_win32_close(), internal window could not exist, and if it does it's going to be destroyed just after that anyway. Also it causes window_proc() to be called and crash because it gets a NULL context. When called from gst_gl_window_win32_set_window_handle() we are going to set another parent anyway, and it's probably better to reparent directly instead of passing by a NULL parent which could cause the internal window to popup briefly. https://bugzilla.gnome.org/show_bug.cgi?id=749601 --- gst-libs/gst/gl/win32/gstglwindow_win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/win32/gstglwindow_win32.c b/gst-libs/gst/gl/win32/gstglwindow_win32.c index b17d28b01c..bead38b1c3 100644 --- a/gst-libs/gst/gl/win32/gstglwindow_win32.c +++ b/gst-libs/gst/gl/win32/gstglwindow_win32.c @@ -182,6 +182,7 @@ set_parent_win_id (GstGLWindowWin32 * window_win32) /* no parent so the internal window needs borders and system menu */ SetWindowLongPtr (window_win32->internal_win_id, GWL_STYLE, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW); + SetParent (window_win32->internal_win_id, NULL); return; } @@ -229,7 +230,6 @@ release_parent_win_id (GstGLWindowWin32 * window_win32) SetWindowLongPtr (window_win32->parent_win_id, GWLP_WNDPROC, (LONG_PTR) parent_proc); - SetParent (window_win32->internal_win_id, NULL); RemoveProp (window_win32->parent_win_id, "gl_window_parent_proc"); }