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 766455 - nlecomposition: ensure elements pending to be added are not leaked
nlecomposition: ensure elements pending to be added are not leaked
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-editing-services
git master
Other Linux
: Normal normal
: 1.8.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-05-14 21:15 UTC by Aurélien Zanelli
Modified: 2016-06-07 16:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[1/2] nlecomposition: fix nle_composition_remove_object info message (1001 bytes, patch)
2016-05-14 21:17 UTC, Aurélien Zanelli
none Details | Review
[2/2] nlecomposition: ensure elements pending to be added are not leaked (2.93 KB, patch)
2016-05-14 21:19 UTC, Aurélien Zanelli
committed Details | Review

Description Aurélien Zanelli 2016-05-14 21:15:19 UTC
Currently, when nlecomposition object is finalized with pending elements to be added in bin (in action or in pending_io), these elements are not unreffed and so they are leaked since from user point of view references are given during gst_bin_add.

This can easily happen if the state of the nlecomposition element is in NULL state: action processing task is not running; or if changes have not been committed.

Below is two snippets of code used to check leaks with GST_TRACE

/* test case with pending actions */
GstElement *bin = gst_element_factory_make ("nlecomposition", NULL);
GstElement *operation = gst_element_factory_make ("nleoperation", NULL);
gst_bin_add (GST_BIN (bin), operation);
gst_object_unref (bin);

/* test case with pending io, ie not committed */
GstElement *bin = gst_element_factory_make ("nlecomposition", NULL);
GstElement *operation = gst_element_factory_make ("nleoperation", NULL);
gst_bin_add (GST_BIN (bin), operation);
gst_element_set_state (bin, GST_STATE_READY);
g_usleep (1 * G_USEC_PER_SEC);
gst_element_set_state (bin, GST_STATE_NULL);
gst_object_unref (bin);
Comment 1 Aurélien Zanelli 2016-05-14 21:17:04 UTC
Created attachment 327899 [details] [review]
[1/2] nlecomposition: fix nle_composition_remove_object info message

Simple patch to fix a log message when removing internal bin.
Comment 2 Aurélien Zanelli 2016-05-14 21:19:42 UTC
Created attachment 327900 [details] [review]
[2/2] nlecomposition: ensure elements pending to be added are not leaked

Patch proposal to fix the leak.

THe idea is to have each stage hold a reference on the element to be added and release it when stage is done.