Commit 08016dc3 authored by Alexandre Julliard's avatar Alexandre Julliard

Grab the thread object in case the thread terminates with pending

async requests (spotted by Andreas Mohr).
parent 632d0c2d
...@@ -56,7 +56,7 @@ void destroy_async( struct async *async ) ...@@ -56,7 +56,7 @@ void destroy_async( struct async *async )
async->q = NULL; async->q = NULL;
async->next = NULL; async->next = NULL;
async->prev = NULL; async->prev = NULL;
release_object( async->thread );
free(async); free(async);
} }
...@@ -127,7 +127,7 @@ struct async *create_async(struct object *obj, struct thread *thread, ...@@ -127,7 +127,7 @@ struct async *create_async(struct object *obj, struct thread *thread,
} }
async->obj = obj; async->obj = obj;
async->thread = thread; async->thread = (struct thread *)grab_object(thread);
async->overlapped = overlapped; async->overlapped = overlapped;
async->next = NULL; async->next = NULL;
async->prev = NULL; async->prev = NULL;
...@@ -178,4 +178,3 @@ DECL_HANDLER(register_async) ...@@ -178,4 +178,3 @@ DECL_HANDLER(register_async)
obj->ops->queue_async (obj, req->overlapped, req->status, req->type, req->count); obj->ops->queue_async (obj, req->overlapped, req->status, req->type, req->count);
release_object(obj); release_object(obj);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment