Closure passed to async method loses reference to local vars
Submitted by Nor Jaidi Tuah
Link to original bug (#653143)
Description
Created attachment 190404 closure passed to async method
In this code: var f = etc; async_func ( () => { fn (f);} );
the lambda may not be able to access f correctly, sometimes resulting in a segmentation fault.
In the attachment, the expected output is hello hello hello bye
But I got: hello hello (null) bye
The bug is due to incorrect access to x in the following: var x = "hello"; f2 (() => {stdout.printf ("%s\n", x);});
Attachment 190404, "closure passed to async method":
asyncclosure.vala
Version: 0.13.x