A failing task extension produces zombi objects and resource leaks
Original author: sebastian.huber
In _Thread_Initialize() we have this code:
_Objects_Open_u32( &information->Objects, &the_thread->Object, config->name );
/*
* We assume the Allocator Mutex is locked and dispatching is
* enabled when we get here. We want to be able to run the
* user extensions with dispatching enabled. The Allocator
* Mutex provides sufficient protection to let the user extensions
* run safely.
*/
extension_status = _User_extensions_Thread_create( the_thread );
if ( extension_status )
return true;
If an extension fails, then the thread object is not closed. Also the delete extensions are not called. If a later create extension fails, the earlier create extensions may have allocated resources which could be freed by a corresponding delete extension.
Edited by Amar Takhar