GNOME Bugzilla – Bug 712683
Vala.Method can keep a strong circular reference preventing deallocation of memory
Last modified: 2013-12-14 13:13:53 UTC
The Vala.Method._base_interface_method field is a strong reference to a Vala.Method which can be set to itself in the case of an interface. This reference can prevent deallocation of a lot of objects when using libvala. A minimal example showing the issue: interface I { public abstract void i(); } class C { public void call_I(I i) { i.i(); } } Changing the reference to a weak reference seems to fix the issue, but I'm not sure if it was intentionally strong for another reason.
Created attachment 260244 [details] [review] Make Vala.Method._base_interface_method weak This fixes a circular reference for interface methods which have themselves as their base method.
Review of attachment 260244 [details] [review]: Ok thanks.
commit 911e3cfefb3fb10bcd99c6220064aff5a62eb746 Author: Jesse van den Kieboom <jessevdk@gmail.com> Date: Tue Nov 19 15:38:34 2013 +0100 Make Vala.Method._base_interface_method weak This fixes a circular reference for interface methods which have themselves as their base method. https://bugzilla.gnome.org/show_bug.cgi?id=712683 This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.