-
Notifications
You must be signed in to change notification settings - Fork 144
[Gen] Always free strdup strings as they're not held by native #163
Conversation
|
Actually, some of these bindings look incorrect. The char stuff should take in a simple char, gtk_label_get should be using an out string, ParseArgs should be using a ref array. Only the paint/draw/pango stuff seem to be generated correctly now |
generator/MarshalGen.cs
Outdated
|
|
||
| public string ReleaseNative (string native_var) | ||
| { | ||
| return $"GLib.Marshaller.Free ({native_var})"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does gtk-sharp depend already in a high enough version of mono to support interpolated strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jenkins does have Mono 4.4. I think we should bump the required version in the configure file.
In any case, I don't like this patch, but there's not much without rewriting the generator typesystem, and I prefer to do that in master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to do that in master.
Yes please! But only after we release a gtk3.0 version ok? Otherwise we lose the stability that master has now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should bump the required version in the configure file.
Probably, but not only for this little patch. How about doing that after releasing a new gtk#2.x version? @meebey needs it for smuxi.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already depend on .NET 4.6 at build time (not runtime) for the string marshalling optimizations.
This fixes a few leaks caused by gstrdup-ing by firing and forgetting.
3731b24 to
150162e
Compare
This fixes a few leaks caused by gstrdup-ing by firing and forgetting.
https://gist.github.com/Therzok/822d377e69476d172f434aa79ef74aed