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
429 stars 140 forks source link

Leak fixes #166

Closed Therzok closed 8 years ago

Therzok commented 8 years ago

Revert the memory fixes added in https://github.com/mono/gtk-sharp/pull/136 and only kept InitiallyOwned logic.

The problem is that whenever you'd create an object in managed, i.e. new ListStore(typeof(string))

This would create an object that would never get unref'd after being owned by managed. This caused the reference to remain a strong ref, so the finalizers would never work.

On the other hand, we'd have a too big refcount at the time of Disposal, meaning memory wouldn't be cleaned up.

Kept InitiallyUnowned logic from master that would wrongly ref a Gtk.Object.

knocte commented 8 years ago

Reason for closing?

Therzok commented 8 years ago

The problem is that with current 2-12, we seemingly leak GLib objects passed into GLib.

Without this patch, we leak pure Gtk widgets, i.e. Gtk.Dialog.VBox is a permanent leak.

I'm trying to figure fix everything up before I send another PR.