mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 02:15:31 +00:00
allocator: Copy allocator name in gst_allocator_register()
The parameter is not marked as `transfer full` and stays around in the hash table, so we will have to copy it ourselves. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3369>
This commit is contained in:
parent
3cc45d5a36
commit
ef8474aad5
1 changed files with 3 additions and 2 deletions
|
@ -233,7 +233,8 @@ gst_allocator_register (const gchar * name, GstAllocator * allocator)
|
||||||
g_rw_lock_writer_lock (&lock);
|
g_rw_lock_writer_lock (&lock);
|
||||||
/* The ref will never be released */
|
/* The ref will never be released */
|
||||||
GST_OBJECT_FLAG_SET (allocator, GST_OBJECT_FLAG_MAY_BE_LEAKED);
|
GST_OBJECT_FLAG_SET (allocator, GST_OBJECT_FLAG_MAY_BE_LEAKED);
|
||||||
g_hash_table_insert (allocators, (gpointer) name, (gpointer) allocator);
|
g_hash_table_insert (allocators, (gpointer) g_strdup (name),
|
||||||
|
(gpointer) allocator);
|
||||||
g_rw_lock_writer_unlock (&lock);
|
g_rw_lock_writer_unlock (&lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,7 +600,7 @@ void
|
||||||
_priv_gst_allocator_initialize (void)
|
_priv_gst_allocator_initialize (void)
|
||||||
{
|
{
|
||||||
g_rw_lock_init (&lock);
|
g_rw_lock_init (&lock);
|
||||||
allocators = g_hash_table_new_full (g_str_hash, g_str_equal, NULL,
|
allocators = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
|
||||||
gst_object_unref);
|
gst_object_unref);
|
||||||
|
|
||||||
#ifdef HAVE_GETPAGESIZE
|
#ifdef HAVE_GETPAGESIZE
|
||||||
|
|
Loading…
Reference in a new issue