Commit 538b2474 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 09d1c52f
......@@ -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 );
......
......@@ -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 );
}
......
......@@ -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 */
......
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