GNOME Bugzilla – Bug 731017
Assigning transfer container arrays to owned variable results in extra free
Last modified: 2014-12-21 15:29:00 UTC
Created attachment 277588 [details] test case If we have a function which returns a transfer container array, and assign the result to a fully owned variable, Vala will allow it but not generate any code to ref/copy the contents of the array as it would for a transfer none array. Test case attached.
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 700142 ***
Sorry, after all we can handle this case rather than reporting an error. We can threat this differently.
Created attachment 283233 [details] [review] fix (unowned foo)[] to foo[] array copy Proposed patch, still missing a test case that crashes without this patch. I'm going to commit after staging passes, unless you find any culprit. The patch is more delicate than what it seems.
commit a6df1b95af42610a3c580188976a194ac8383d2a Author: Luca Bruno <lucabru@src.gnome.org> Date: Tue Aug 12 23:14:25 2014 +0200 codegen: Fix (unowned foo)[] to foo[] array copy Fixes bug 731017 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.