mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 07:46:38 +00:00
gl: Don't leak pool if set_config failed
This commit is contained in:
parent
38abd7f019
commit
fe283a9aeb
2 changed files with 9 additions and 6 deletions
|
@ -165,13 +165,14 @@ gst_gl_mixer_propose_allocation (GstGLBaseMixer * base_mix,
|
||||||
|
|
||||||
config = gst_buffer_pool_get_config (pool);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
||||||
if (!gst_buffer_pool_set_config (pool, config))
|
|
||||||
|
if (!gst_buffer_pool_set_config (pool, config)) {
|
||||||
|
g_object_unref (pool);
|
||||||
goto config_failed;
|
goto config_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pool) {
|
|
||||||
gst_query_add_allocation_pool (query, pool, size, 1, 0);
|
gst_query_add_allocation_pool (query, pool, size, 1, 0);
|
||||||
gst_object_unref (pool);
|
g_object_unref (pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we also support various metadata */
|
/* we also support various metadata */
|
||||||
|
|
|
@ -230,8 +230,10 @@ _gl_memory_upload_propose_allocation (gpointer impl, GstQuery * decide_query,
|
||||||
size = info.size;
|
size = info.size;
|
||||||
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
||||||
|
|
||||||
if (!gst_buffer_pool_set_config (pool, config))
|
if (!gst_buffer_pool_set_config (pool, config)) {
|
||||||
|
gst_object_unref (pool);
|
||||||
goto config_failed;
|
goto config_failed;
|
||||||
|
}
|
||||||
|
|
||||||
gst_query_add_allocation_pool (query, pool, size, 1, 0);
|
gst_query_add_allocation_pool (query, pool, size, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue