}
}
+ fs_file_close(fp);
+ return true;
+}
+
+void code_cleanup(code_t *code) {
vec_free(code->statements);
vec_free(code->linenums);
vec_free(code->defs);
util_htdel(code->string_cache);
- fs_file_close(fp);
mem_d(code);
- return true;
}
static GMQCC_INLINE void ftepp_macro_delete(ftepp_t *ftepp, const char *name)
{
- util_htrm(ftepp->macros, name, NULL);
+ util_htrm(ftepp->macros, name, (void (*)(void*))&ppmacro_delete);
}
static GMQCC_INLINE int ftepp_next(ftepp_t *ftepp)
return false;
}
-#if 0
- if (ftepp->output_on)
- vec_push(ftepp->macros, macro);
-#endif
if (ftepp->output_on)
util_htset(ftepp->macros, macro->name, (void*)macro);
else {
*/
bool code_write (code_t *, const char *filename, const char *lno);
code_t *code_init (void);
+void code_cleanup (code_t *);
uint32_t code_genstring (code_t *, const char *string);
qcint code_alloc_field (code_t *, size_t qcsize);
void code_push_statement(code_t *, prog_section_statement *stmt, int linenum);
ir_value_delete(self->extparams[i]);
}
vec_free(self->extparams);
+ vec_free(self->extparam_protos);
for (i = 0; i != vec_size(self->globals); ++i) {
ir_value_delete(self->globals[i]);
}
mem_d(parser);
return NULL;
}
-
for (i = 0; i < operator_count; ++i) {
if (operators[i].id == opid1('=')) {
intrin_intrinsics_destroy(parser);
+ code_cleanup(parser->code);
+
mem_d(parser);
}