mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +00:00
gstd3d11window: fix memory leak
GstStructure may leak when using external HWND Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4373>
This commit is contained in:
parent
7e619f7e83
commit
d7d0c969df
1 changed files with 2 additions and 0 deletions
|
@ -226,6 +226,7 @@ gst_d3d11_window_win32_prepare (GstD3D11Window * window, guint display_width,
|
|||
|
||||
hwnd = (HWND) window->external_handle;
|
||||
if (!IsWindow (hwnd)) {
|
||||
gst_structure_free (config);
|
||||
GST_ERROR_OBJECT (self, "Invalid window handle");
|
||||
g_set_error (error, GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_FAILED,
|
||||
"Invalid window handle");
|
||||
|
@ -235,6 +236,7 @@ gst_d3d11_window_win32_prepare (GstD3D11Window * window, guint display_width,
|
|||
GST_DEBUG_OBJECT (self, "Preparing external handle");
|
||||
ret = gst_d3d11_window_win32_set_external_handle (self, hwnd);
|
||||
if (ret != GST_FLOW_OK) {
|
||||
gst_structure_free (config);
|
||||
if (ret == GST_FLOW_FLUSHING) {
|
||||
GST_WARNING_OBJECT (self, "Flushing");
|
||||
return GST_FLOW_FLUSHING;
|
||||
|
|
Loading…
Reference in a new issue