After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 712683 - Vala.Method can keep a strong circular reference preventing deallocation of memory
Vala.Method can keep a strong circular reference preventing deallocation of m...
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Semantic Analyzer
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2013-11-19 14:26 UTC by jessevdk@gmail.com
Modified: 2013-12-14 13:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make Vala.Method._base_interface_method weak (885 bytes, patch)
2013-11-19 14:39 UTC, jessevdk@gmail.com
accepted-commit_now Details | Review

Description jessevdk@gmail.com 2013-11-19 14:26:17 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.
Comment 1 jessevdk@gmail.com 2013-11-19 14:39:02 UTC
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.
Comment 2 Luca Bruno 2013-11-19 19:12:18 UTC
Review of attachment 260244 [details] [review]:

Ok thanks.
Comment 3 Luca Bruno 2013-12-14 13:13:53 UTC
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.