2
0
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:
Vladimir Prus
2002-07-05 10:41:53 +00:00
parent f819bcc989
commit 14237dc18a
2 changed files with 43 additions and 0 deletions

View File

@@ -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 )
{

View File

@@ -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 );