server: Always set the async result when the APC object is destroyed.
commit44fc44880f2074cbc3c586ffc8dea009608b63dc
authorZebediah Figura <z.figura12@gmail.com>
Wed, 24 Feb 2021 22:11:35 +0000 (24 16:11 -0600)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 25 Feb 2021 07:54:41 +0000 (25 08:54 +0100)
treed4a3fe882f10a7c30f0876264b2ad0bc7b2f792c
parent4eddeff18a75445a8dc46829784019add34704eb
server: Always set the async result when the APC object is destroyed.

This can happen if the async is terminated while there is no thread to queue
the APC to (as in the relevant test), or if the client dies before getting the
APC, or before transferring the APC results back to the server.

This also fixes a leak of async objects present since 61abc500f5. If a process
dies while accept asyncs are pending, the asyncs will be terminated but will
not find a valid thread to queue the APC to, and thus async_set_result() and
the completion callback are never called.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/kernel32/tests/pipe.c
server/thread.c