GNOME Bugzilla – Bug 793870
Gst_Pipeline: Avoid creating a member for GstBus
Last modified: 2018-03-13 13:20:03 UTC
Created attachment 368991 [details] [review] GstPipeline: Avoid creating a redundant member for 'GstBus' It is a part of generated codes, but I don't have any idea where the difference comes from. Recently, the generated codes are pushed into the repository so I create a patch for the generated code. For Gst_Element, it just has 'public Gst.Bus', but in case of Gst_Pipeline, it has 'public new Gst.Bus' as a member. As a result, an application has two different bus objects and it causes memory leakage.
Review of attachment 368991 [details] [review]: As you noticed this file is auto generated, you should never edit them directly. I belive the difference is due to the fact that GstElement.Bus is generated by the field ` <field cname="bus" access="public" writeable="false" readable="true" is_callback="false" name="Bus" type="GstBus*"/>` whereas the GstPipeline.Bus is generated by the method `<method name="GetBus" cname="gst_pipeline_get_bus">`. I guess what you want is to hide the method adding an override in https://cgit.freedesktop.org/gstreamer/gstreamer-sharp/tree/sources/gstreamer-sharp.metadata - read the readme to regenerate the code.
Thank you for comment. I found that gapi3-codegen forcedly adds "new" modifier if a parent has the same property name. It shouldn't be a gstreamer-sharp issue so I file a bug to gtk-sharp.
(In reply to Justin J. Kim from comment #3) > Thank you for comment. I found that gapi3-codegen forcedly adds "new" > modifier if a parent has the same property name. It shouldn't be a > gstreamer-sharp issue so I file a bug to gtk-sharp. In that cae those are the same, so you should just hide `gst_pipeline_get_bus`.
Created attachment 369098 [details] [review] Gst.Pipeline: Hide GetBus Hiding 'GetBus' is a simpler way to fix this issue, thank you!
Review of attachment 369098 [details] [review]: Just to make sure, Gst_Pipeline.cs was generate exactly like that?
(In reply to Thibault Saunier from comment #6) > Review of attachment 369098 [details] [review] [review]: > > Just to make sure, Gst_Pipeline.cs was generate exactly like that? Sure. It is a generated code.
Created attachment 369598 [details] [review] Gst.Pipeline: Hide GetBus I touched only 'sources/gstreamer-sharp.metadata'. The others were generated by `ninja -C build update_gstreamer_code` command.
Attachment 369598 [details] pushed as 1bcec1e - Gst.Pipeline: Hide GetBus