From 0901b23206724e2dcef51e04b16ac2add70b703f Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 14 Jun 2005 19:16:56 +0000 Subject: [PATCH] Call the close_handle notification for all objects when releasing a handle table. --- server/handle.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/server/handle.c b/server/handle.c index 4a708439406..802e07df1ef 100644 --- a/server/handle.c +++ b/server/handle.c @@ -139,11 +139,21 @@ static void handle_table_destroy( struct object *obj ) { int i; struct handle_table *table = (struct handle_table *)obj; - struct handle_entry *entry = table->entries; + struct handle_entry *entry; 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; entry->ptr = NULL;