mirror of
https://github.com/boostorg/build.git
synced 2026-02-12 12:02:24 +00:00
Eliminated several minor leaks.
[SVN r14305]
This commit is contained in:
@@ -291,6 +291,33 @@ copysettings( SETTINGS *head )
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* freetargets() - delete a targets list
|
||||
*/
|
||||
void freetargets( TARGETS *chain )
|
||||
{
|
||||
while( chain )
|
||||
{
|
||||
TARGETS* n = chain->next;
|
||||
free( chain );
|
||||
chain = n;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* freeactions() - delete an action list
|
||||
*/
|
||||
void freeactions( ACTIONS *chain )
|
||||
{
|
||||
while( chain )
|
||||
{
|
||||
ACTIONS* n = chain->next;
|
||||
free( chain );
|
||||
chain = n;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* freesettings() - delete a settings list
|
||||
*/
|
||||
@@ -311,6 +338,19 @@ freesettings( SETTINGS *v )
|
||||
}
|
||||
}
|
||||
|
||||
static void freetarget( void *xt, void *data )
|
||||
{
|
||||
TARGET* t = (TARGET *)xt;
|
||||
if ( t->settings )
|
||||
freesettings( t->settings );
|
||||
if ( t->deps[0] )
|
||||
freetargets( t->deps[0] );
|
||||
if ( t->deps[1] )
|
||||
freetargets( t->deps[1] );
|
||||
if ( t->actions )
|
||||
freeactions( t->actions );
|
||||
}
|
||||
|
||||
/*
|
||||
* donerules() - free TARGET tables
|
||||
*/
|
||||
@@ -318,6 +358,7 @@ freesettings( SETTINGS *v )
|
||||
void
|
||||
donerules()
|
||||
{
|
||||
hashenumerate( targethash, freetarget, 0 );
|
||||
hashdone( targethash );
|
||||
while ( settings_freelist )
|
||||
{
|
||||
|
||||
@@ -219,7 +219,9 @@ TARGET *bindtarget( char *targetname );
|
||||
void touchtarget( char *t );
|
||||
TARGETS *targetlist( TARGETS *chain, LIST *targets );
|
||||
TARGETS *targetentry( TARGETS *chain, TARGET *target );
|
||||
void freetargets( TARGETS *chain );
|
||||
ACTIONS *actionlist( ACTIONS *chain, ACTION *action );
|
||||
void freeactions( ACTIONS *chain );
|
||||
SETTINGS *addsettings( SETTINGS *head, int append, char *symbol, LIST *value );
|
||||
void pushsettings( SETTINGS *v );
|
||||
void popsettings( SETTINGS *v );
|
||||
|
||||
Reference in New Issue
Block a user