GNOME Bugzilla – Bug 776805
uri-asset: GstDiscoverer are never freeed
Last modified: 2017-02-06 12:56:02 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.
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.
(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.
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.
What about something like this?
Attachment 345029 [details] pushed as 53c5bc0 - introduce ges_deinit()