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 776805 - uri-asset: GstDiscoverer are never freeed
uri-asset: GstDiscoverer are never freeed
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-editing-services
unspecified
Other Linux
: Normal minor
: 1.11.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-03 10:47 UTC by Guillaume Desmottes
Modified: 2017-02-06 12:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
introduce ges_deinit() (15.05 KB, patch)
2017-02-06 12:00 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2017-01-03 10:47:08 UTC
ges_uri_clip_asset_class_init() creates two GstDiscoverer instances (klass->discoverer and klass->sync_discoverer) which are never freed.

It's annoying as it makes tracking memory leaks pretty hard. Marking those as LEAKED isn't really an option as they create a lot of other objects.

An option could be to turn those to static global variables and free them when a ges_deinit() is called, or something like that.
Comment 1 Thibault Saunier 2017-01-03 11:23:18 UTC
Right, this is quite annoying indeed.

> An option could be to turn those to static global variables and free them when a ges_deinit() is called, or something like that.

Registering a GClassFinalizeFunc/GBaseFinalizeFunc would not work either as it would happen too late?

It would look a bit weird to have a static global variable as we have a ges_uri_clip_asset_class_set_timeout but well, it wouldn't be a big deal either.
Comment 2 Guillaume Desmottes 2017-01-03 11:38:12 UTC
(In reply to Thibault Saunier from comment #1)
> Right, this is quite annoying indeed.
> 
> > An option could be to turn those to static global variables and free them when a ges_deinit() is called, or something like that.
> 
> Registering a GClassFinalizeFunc/GBaseFinalizeFunc would not work either as
> it would happen too late?

IIRC those are no longer called. The type system keeps the class alive during the whole lifetime of the app.
Comment 3 Guillaume Desmottes 2017-02-06 12:00:42 UTC
Created attachment 345029 [details] [review]
introduce ges_deinit()

GstDiscoverer objects were leaked by tests making the leaks detector
unusable.
Introduce ges_deinit(), similiar to gst_deinit(), doing some cleanup
before exiting the process.
Comment 4 Guillaume Desmottes 2017-02-06 12:01:01 UTC
What about something like this?
Comment 5 Thibault Saunier 2017-02-06 12:55:27 UTC
Attachment 345029 [details] pushed as 53c5bc0 - introduce ges_deinit()