mono / gtk-sharp

Gtk# is a Mono/.NET binding to the cross platform Gtk+ GUI toolkit and the foundation of most GUI apps built with Mono
http://www.mono-project.com/GtkSharp
Other
426 stars 141 forks source link

Safehandle finalization #200

Closed Therzok closed 7 years ago

Therzok commented 7 years ago

Should I use a simple object instead of a safehandle and implement finalizer/dispose? The current approach makes dispose queue on a timeout too. We'd also save a few bytes per object by just wrapping an IntPtr and not the additional safehandle states.

alanmcgovern commented 7 years ago

That'd make sense. We don't actually use SafeHandles correctly so it doesn't make a whole lot of sense.

However, to go back to my original "should we make this private" question about th safehandle class - if we make these implementation details public we'll never be able to change them again. A normal finalizable object makes sense, but I think we should make it a non-public class ;)

Therzok commented 7 years ago

I have an idea of how to make it non-public and I will implement it.

alanmcgovern commented 7 years ago

Wanna squash and merge it?