mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:16:13 +00:00
gl: win32: Fix leaked GstGLContext
https://bugzilla.gnome.org/show_bug.cgi?id=749601
This commit is contained in:
parent
8f268785d6
commit
db0380a9ee
1 changed files with 10 additions and 6 deletions
|
@ -458,6 +458,8 @@ LRESULT CALLBACK
|
||||||
window_proc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
window_proc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
GstGLWindowWin32 *window_win32;
|
GstGLWindowWin32 *window_win32;
|
||||||
|
LRESULT ret = 0;
|
||||||
|
|
||||||
if (uMsg == WM_CREATE) {
|
if (uMsg == WM_CREATE) {
|
||||||
window_win32 =
|
window_win32 =
|
||||||
GST_GL_WINDOW_WIN32 (((LPCREATESTRUCT) lParam)->lpCreateParams);
|
GST_GL_WINDOW_WIN32 (((LPCREATESTRUCT) lParam)->lpCreateParams);
|
||||||
|
@ -471,7 +473,6 @@ window_proc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
ReleaseDC (hWnd, window_win32->device);
|
ReleaseDC (hWnd, window_win32->device);
|
||||||
|
|
||||||
SetProp (hWnd, "gl_window", window_win32);
|
SetProp (hWnd, "gl_window", window_win32);
|
||||||
return 0;
|
|
||||||
} else if (GetProp (hWnd, "gl_window")) {
|
} else if (GetProp (hWnd, "gl_window")) {
|
||||||
GstGLWindow *window;
|
GstGLWindow *window;
|
||||||
GstGLContext *context;
|
GstGLContext *context;
|
||||||
|
@ -558,23 +559,26 @@ window_proc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_ERASEBKGND:
|
case WM_ERASEBKGND:
|
||||||
return TRUE;
|
{
|
||||||
|
ret = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
/* transmit messages to the parrent (ex: mouse/keyboard input) */
|
/* transmit messages to the parrent (ex: mouse/keyboard input) */
|
||||||
HWND parent_id = window_win32->parent_win_id;
|
HWND parent_id = window_win32->parent_win_id;
|
||||||
if (parent_id)
|
if (parent_id)
|
||||||
PostMessage (parent_id, uMsg, wParam, lParam);
|
PostMessage (parent_id, uMsg, wParam, lParam);
|
||||||
return DefWindowProc (hWnd, uMsg, wParam, lParam);
|
ret = DefWindowProc (hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_object_unref (context);
|
gst_object_unref (context);
|
||||||
|
|
||||||
return 0;
|
|
||||||
} else {
|
} else {
|
||||||
return DefWindowProc (hWnd, uMsg, wParam, lParam);
|
ret = DefWindowProc (hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT FAR PASCAL
|
LRESULT FAR PASCAL
|
||||||
|
|
Loading…
Reference in a new issue