mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
pool: fix deallocation of video pools.
The queue of free objects to used was deallocated with g_queue_free_full(). However, this convenience function shall only be used if the original queue was allocated with g_queue_new(). This caused memory corruption, eventually leading to a crash. The correct solution is to pair the g_queue_init() with the corresponding g_queue_clear(), while iterating over all free objects to deallocate them.
This commit is contained in:
parent
9b3ad4daad
commit
ac75755105
1 changed files with 2 additions and 1 deletions
|
@ -70,7 +70,8 @@ void
|
|||
gst_vaapi_video_pool_finalize(GstVaapiVideoPool *pool)
|
||||
{
|
||||
g_list_free_full(pool->used_objects, gst_vaapi_object_unref);
|
||||
g_queue_free_full(&pool->free_objects, gst_vaapi_object_unref);
|
||||
g_queue_foreach(&pool->free_objects, (GFunc)gst_vaapi_object_unref, NULL);
|
||||
g_queue_clear(&pool->free_objects);
|
||||
gst_vaapi_display_replace(&pool->display, NULL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue