Open justinjoy opened 6 years ago
Virtual and override do not really make sense for method, the make sense for virtual methods though.
I think the current behaviour is correct, the thing is that in the GstElement VS GstPipeline case, the bus is the exact same (ie. the GstElement one) so we should hide the GstPipeline getter with an override.
I found an issue while trying to fix a leakage[0] of gstreamer-sharp. The problem is that
Gst.Element
andGst.Pipeline
(which is a child ofGst.Element
) hasBus
property. Then, the code generator addsnew
modifier forGst.Pipeline
so an application has a redundant instance which is never unreffed.https://github.com/GLibSharp/GtkSharp/blob/e29851eae80ee696ef6317f67ce53cdf74074420/Source/generator/Property.cs#L111
In the condition above, if a child class has the same property name with its parent, the code generator adds
new
modifier and it ignoresnew_flag
attribute value even if it is set tofalse
.I think the generator should support
virtual
andoverride
modifiers for parent and child respectively. Or, if there's nicer solution, please let me know.[0] https://bugzilla.gnome.org/show_bug.cgi?id=793870