Add support for freeing code emitter objects at the end of compilation.

This commit is contained in:
Paul Sokolovsky
2014-01-24 16:20:11 +02:00
parent 2b2cb7b7f4
commit f46d87a30d
6 changed files with 27 additions and 0 deletions

View File

@@ -3155,6 +3155,9 @@ mp_obj_t mp_compile(mp_parse_node_t pn, qstr source_file, bool is_repl) {
}
bool had_error = comp->had_error;
if (comp->emit_method_table->free != NULL) {
comp->emit_method_table->free(comp->emit);
}
m_del_obj(compiler_t, comp);
uint unique_code_id = module_scope->unique_code_id;
for (scope_t *s = module_scope; s;) {