GNOME Bugzilla – Bug 766455
nlecomposition: ensure elements pending to be added are not leaked
Last modified: 2016-06-07 16:32:18 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);
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.
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.