gl: win32: Fix leaked GstGLContext

https://bugzilla.gnome.org/show_bug.cgi?id=749601
This commit is contained in:
Xavier Claessens 2015-05-20 17:06:42 -04:00 committed by Tim-Philipp Müller
parent 8f268785d6
commit db0380a9ee

View file

@ -458,6 +458,8 @@ LRESULT CALLBACK
window_proc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
GstGLWindowWin32 *window_win32;
LRESULT ret = 0;
if (uMsg == WM_CREATE) {
window_win32 =
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);
SetProp (hWnd, "gl_window", window_win32);
return 0;
} else if (GetProp (hWnd, "gl_window")) {
GstGLWindow *window;
GstGLContext *context;
@ -558,23 +559,26 @@ window_proc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
}
case WM_ERASEBKGND:
return TRUE;
{
ret = TRUE;
break;
}
default:
{
/* transmit messages to the parrent (ex: mouse/keyboard input) */
HWND parent_id = window_win32->parent_win_id;
if (parent_id)
PostMessage (parent_id, uMsg, wParam, lParam);
return DefWindowProc (hWnd, uMsg, wParam, lParam);
ret = DefWindowProc (hWnd, uMsg, wParam, lParam);
}
}
gst_object_unref (context);
return 0;
} else {
return DefWindowProc (hWnd, uMsg, wParam, lParam);
ret = DefWindowProc (hWnd, uMsg, wParam, lParam);
}
return ret;
}
LRESULT FAR PASCAL