Creating GObject via Object.new doesn't take correct ownership of properies
When creating a object via Object.new ()
values past as properties, the ownership of the values isn't handled correctly. It looks like that the value is freed to early. Object.new ()
should probably take ownership or take a copy of the value.
abstract class Foo<T> : Object {
public virtual T foo { get; construct set; }
}
class Bar : Foo<string> {
}
void main () {
Bar bar;
{
string foo = "foo";
bar = (Bar) Object.new (typeof (Bar), "foo", foo);
}
assert (bar.foo == "foo");
}
Many thanks to @ricotz for the reproducer and for the help understanding the issue.