Call the close_handle notification for all objects when releasing a

handle table.
This commit is contained in:
Alexandre Julliard 2005-06-14 19:16:56 +00:00
parent dacc3dbfa5
commit 0901b23206
1 changed files with 12 additions and 2 deletions

View File

@ -139,11 +139,21 @@ static void handle_table_destroy( struct object *obj )
{ {
int i; int i;
struct handle_table *table = (struct handle_table *)obj; struct handle_table *table = (struct handle_table *)obj;
struct handle_entry *entry = table->entries; struct handle_entry *entry;
assert( obj->ops == &handle_table_ops ); assert( obj->ops == &handle_table_ops );
for (i = 0; i <= table->last; i++, entry++) /* 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; struct object *obj = entry->ptr;
entry->ptr = NULL; entry->ptr = NULL;