summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-25 00:04:14 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-25 02:04:07 +0200
commitc1d200ef74c9a76a661cfbb3f2f73db992f0e272 (patch)
tree8f371866390f2f010b5a2d0fc38ad1cc3e80a5d4
parent9a24a0465f4924ae1853a822d245af9e3a24fc2d (diff)
downloadmicropython-c1d200ef74c9a76a661cfbb3f2f73db992f0e272.tar.gz
micropython-c1d200ef74c9a76a661cfbb3f2f73db992f0e272.zip
rt_deinit(): Finalize some maps.
-rw-r--r--py/runtime.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 3d56cc87ba..25992a52c0 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -165,6 +165,7 @@ void rt_init(void) {
mp_module_micropython_init();
+ // TODO: wastes one mp_code_t structure in mem
next_unique_code_id = 1; // 0 indicates "no code"
unique_codes_alloc = 0;
unique_codes = NULL;
@@ -176,6 +177,9 @@ void rt_init(void) {
void rt_deinit(void) {
m_del(mp_code_t, unique_codes, unique_codes_alloc);
+ mp_map_free(map_globals);
+ mp_map_deinit(&map_loaded_modules);
+ mp_map_deinit(&map_builtins);
#ifdef WRITE_CODE
if (fp_write_code != NULL) {
fclose(fp_write_code);