GLibSharp / GtkSharp

.Net bindings for gtk+3 and above
Other
27 stars 21 forks source link

Broken GLib.Value bindings #46

Open sdroege opened 4 years ago

sdroege commented 4 years ago

Currently GLib.Value is a value type (aka struct). This means that it can't have a finalizer and also that it can be simply copied around without any additional operations happening.

All that is fine if the value contains integers or similar things but falls apart if it contains pointers to something else (strings, objects, boxed types, ...). Then it will

Value types should never be used for anything that handles native resources for the above reasons.

Unfortunately changing it to a reference type (aka class) is not so easy due to how it is used everywhere right now.

knuxbbs commented 4 years ago

Should we separate GlibSharp, as I try to make in this project: https://github.com/glib-sharp? Should we have a roadmap?

Sorry for the fork, but I'm using Cake as the building tool, who is much more easy to .NET developers like me.

sdroege commented 4 years ago

Should we separate GlibSharp, as I try to make in this project: https://github.com/glib-sharp? Should we have a roadmap?

You didn't preserve any of the history, which makes it rather useless.

Also there is already yet another fork here: https://github.com/GtkSharp/GtkSharp (which diverged quite a bit from this one and has even worse memory management bugs because of that)