]> git.ipfire.org Git - thirdparty/vala.git/commit
codegen: Make the task_complete flag for < 2.44 more similar to >= 2.44 be27b9e6d1b7cb590dcda6be6621d707887c87cb
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 12 Jun 2017 15:19:05 +0000 (17:19 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 12 Jun 2017 17:13:15 +0000 (19:13 +0200)
commitbe27b9e6d1b7cb590dcda6be6621d707887c87cb
tree9321a66440800d13ec16a5fb4bf6c173a88bafed
parenta667b82aab0fecb6f932de54ddfd0a577e3f8cd7
codegen: Make the task_complete flag for < 2.44 more similar to >= 2.44

According to the g_task_get_completed() docs (which we rely on for
glib >= 2.44 targets): "This changes from FALSE to TRUE after the task's
callback is invoked, and will return FALSE from inside the callback".

So to make the code paths most similar to >= 2.44 (when
g_task_get_completed is available), wrap the GAsyncReadyCallback with
one of our own, that just invokes the nested callback (if any) and turns
on the flag.

Also remove the code turning on the flag on finish(), it's superfluous
now and there are no guarantees that it will be invoked.

https://bugzilla.gnome.org/show_bug.cgi?id=783543
codegen/valagasyncmodule.vala
tests/Makefile.am
tests/asynchronous/bug783543.vala [new file with mode: 0644]