glupload: Fix a memory leak point in gst_egl_image_cache_unref()

The image cache itself should be freed when ref_count is 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4723>
This commit is contained in:
He Junyan 2023-05-25 14:48:11 +08:00 committed by GStreamer Marge Bot
parent 26a451b59d
commit e23964cb5f

View file

@ -528,6 +528,7 @@ gst_egl_image_cache_unref (GstEGLImageCache * cache)
if (g_atomic_int_dec_and_test (&cache->ref_count)) { if (g_atomic_int_dec_and_test (&cache->ref_count)) {
g_hash_table_unref (cache->hash_table); g_hash_table_unref (cache->hash_table);
g_mutex_clear (&cache->lock); g_mutex_clear (&cache->lock);
g_free (cache);
} }
} }