| 99 | static void free_fixed_variable( void * xvar, void * data ); |
| 100 | |
| 101 | void delete_module( module_t * m ) |
| 102 | { |
| 103 | /* Clear out all the rules. */ |
| 104 | if ( m->rules ) |
| 105 | { |
| 106 | hashenumerate( m->rules, delete_rule_, (void *)0 ); |
| 107 | hash_free( m->rules ); |
| 108 | m->rules = 0; |
| 109 | } |
| 110 | |
| 111 | if ( m->native_rules ) |
| 112 | { |
| 113 | hashenumerate( m->native_rules, delete_native_rule, (void *)0 ); |
| 114 | hash_free( m->native_rules ); |
| 115 | m->native_rules = 0; |
| 116 | } |
| 117 | |
| 118 | if ( m->variables ) |
| 119 | { |
| 120 | var_done( m ); |
| 121 | m->variables = 0; |
| 122 | } |
| 123 | |
| 124 | if ( m->fixed_variables ) |
| 125 | { |
| 126 | int i; |
| 127 | for ( i = 0; i < m->num_fixed_variables; ++i ) |
| 128 | { |
| 129 | list_free( m->fixed_variables[ i ] ); |
| 130 | } |
| 131 | BJAM_FREE( m->fixed_variables ); |
| 132 | m->fixed_variables = 0; |
| 133 | } |
| 134 | |
| 135 | if ( m->variable_indices ) |
| 136 | { |
| 137 | hashenumerate( m->variable_indices, &free_fixed_variable, (void *)0 ); |
| 138 | hash_free( m->variable_indices ); |
| 139 | m->variable_indices = 0; |
| 140 | } |
| 141 | |
| 142 | if ( m->imported_modules ) |
| 143 | { |
| 144 | hashenumerate( m->imported_modules, delete_imported_modules, (void *)0 ); |
| 145 | hash_free( m->imported_modules ); |
| 146 | m->imported_modules = 0; |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | |
| 151 | struct module_stats |
no test coverage detected