gtask: Warn if a GTask is finalised without returning
This typically indicates a bug in the program, where a GTask has been created, but a bug in the control flow has caused it to not return a value.
There is one situation where it might be legitimate to finalise a GTask
without returning: if an error happens in your
*_async() start function
after you’ve created a GTask, but before the async operation returns to
the main loop; and you report the error using
rather than reporting it using the newly constructed GTask.
That approach is not currently a bug, but this change effectively turns it into one. I think the advantages of being able to capture bugs in complex GTask control flows outweigh the disadvantages of some callers having to change their code to not use g_task_report_*error() after constructing a custom GTask.
Signed-off-by: Philip Withnall email@example.com