server: Free client-side user handles at process exit.

This commit is contained in:
Alexandre Julliard 2009-10-15 17:56:04 +02:00
parent 09d1c52fa0
commit 538b24747c
3 changed files with 13 additions and 1 deletions

View File

@ -645,6 +645,7 @@ static void process_killed( struct process *process )
free( dll );
}
destroy_process_classes( process );
free_process_user_handles( process );
remove_process_locks( process );
set_process_startup_state( process, STARTUP_ABORTED );
finish_process_tracing( process );

View File

@ -166,10 +166,20 @@ void *next_user_handle( user_handle_t *handle, enum user_object type )
return NULL;
}
/* free client-side user handles managed by the process */
void free_process_user_handles( struct process *process )
{
unsigned int i;
for (i = 0; i < nb_handles; i++)
if (handles[i].type == USER_CLIENT && handles[i].ptr == process)
free_user_entry( &handles[i] );
}
/* allocate an arbitrary user handle */
DECL_HANDLER(alloc_user_handle)
{
reply->handle = alloc_user_handle( NULL, USER_CLIENT );
reply->handle = alloc_user_handle( current->process, USER_CLIENT );
}

View File

@ -72,6 +72,7 @@ extern void *get_user_object_handle( user_handle_t *handle, enum user_object typ
extern user_handle_t get_user_full_handle( user_handle_t handle );
extern void *free_user_handle( user_handle_t handle );
extern void *next_user_handle( user_handle_t *handle, enum user_object type );
extern void free_process_user_handles( struct process *process );
/* clipboard functions */