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.
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);
}