After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 731350 - Add gst_queue_array_new variant which takes a GDestroyNotify
Add gst_queue_array_new variant which takes a GDestroyNotify
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other Linux
: Normal trivial
: 1.3.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-06-06 23:51 UTC by Evan Nemerson
Modified: 2014-06-28 08:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
queuearray: add gst_queue_array_new_with_free_func (2.66 KB, patch)
2014-06-06 23:51 UTC, Evan Nemerson
needs-work Details | Review

Description Evan Nemerson 2014-06-06 23:51:36 UTC
Created attachment 278065 [details] [review]
queuearray: add gst_queue_array_new_with_free_func

GstQueueArray is currently of limited use because it's not really possible for it to hold ownership of pointers it contains--if gst_queue_array_free is called while the queue is not empty the contents are leaked.

I don't know that GstQueueArray can ever really be usable from most GObject Introspection consumers (see bug #639908), but we could turn it into a pretty nice generic in Vala if you added something like

  GstQueueArray *
  gst_queue_array_new_with_free_func (guint initial_size,
                                      GDestroyNotify element_free);

The GDestroyNotify can be stored in the GstQueueArray struct (it's private, so no API/ABI break) and called if necessary in gst_queue_array_free.
Comment 1 Sebastian Dröge (slomo) 2014-06-22 15:14:01 UTC
Comment on attachment 278065 [details] [review]
queuearray: add gst_queue_array_new_with_free_func

This API is mostly useless for other languages. They have their own data structures.

We should just hide it from introspection.
Comment 2 Sebastian Dröge (slomo) 2014-06-26 17:32:51 UTC
commit 0d5177b5fe12a130fbb96be8b7ada82e81500f84
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Thu Jun 26 19:30:52 2014 +0200

    queuearray: Hide from bindings
    
    Other languages have their own data structures that are more convenient to use.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=731350