server: Keep reference to terminated async in free_async_queue.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2018-02-26 19:14:24 +01:00 committed by Alexandre Julliard
parent 12c6ac5fd7
commit 1356afed5a
1 changed files with 2 additions and 0 deletions

View File

@ -192,10 +192,12 @@ void free_async_queue( struct async_queue *queue )
LIST_FOR_EACH_ENTRY_SAFE( async, next, &queue->queue, struct async, queue_entry ) LIST_FOR_EACH_ENTRY_SAFE( async, next, &queue->queue, struct async, queue_entry )
{ {
grab_object( &async->obj );
if (!async->completion) async->completion = fd_get_completion( async->fd, &async->comp_key ); if (!async->completion) async->completion = fd_get_completion( async->fd, &async->comp_key );
async->fd = NULL; async->fd = NULL;
async_terminate( async, STATUS_HANDLES_CLOSED ); async_terminate( async, STATUS_HANDLES_CLOSED );
async->queue = NULL; async->queue = NULL;
release_object( &async->obj );
} }
} }