Skip to content
Snippets Groups Projects
Commit a17469b1 authored by Elizabeth Figura's avatar Elizabeth Figura Committed by Alexandre Julliard
Browse files

server: Call the close_handle callback and release_object_from_handle() in the same loop.


Several server objects check if the last handle is being closed in their
close_handle callback. If a process holds the last two handles to an object,
this code path currently won't be triggered.

Signed-off-by: default avatarZebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard's avatarAlexandre Julliard <julliard@winehq.org>
parent 3f04fdd8
No related branches found
No related tags found
No related merge requests found
......@@ -174,21 +174,16 @@ static void handle_table_destroy( struct object *obj )
assert( obj->ops == &handle_table_ops );
/* first notify all objects that handles are being closed */
if (table->process)
{
for (i = 0, entry = table->entries; i <= table->last; i++, entry++)
{
struct object *obj = entry->ptr;
if (obj) obj->ops->close_handle( obj, table->process, index_to_handle(i) );
}
}
for (i = 0, entry = table->entries; i <= table->last; i++, entry++)
{
struct object *obj = entry->ptr;
entry->ptr = NULL;
if (obj) release_object_from_handle( obj );
if (obj)
{
if (table->process)
obj->ops->close_handle( obj, table->process, index_to_handle(i) );
release_object_from_handle( obj );
}
}
free( table->entries );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment