diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2021-08-18 11:51:10 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-08-19 17:31:02 +1000 |
commit | 5555f147dfb23d76bab4fcb688a5a254bc487a63 (patch) | |
tree | df8a76b2d616bbcdeabc9303cb671a0364d8773b /py/lexer.c | |
parent | 44818d1a35315c4dde34050eb0aac98866f9eb15 (diff) | |
download | micropython-5555f147dfb23d76bab4fcb688a5a254bc487a63.tar.gz micropython-5555f147dfb23d76bab4fcb688a5a254bc487a63.zip |
py/lexer: Clear fstring_args vstr on lexer free.
This was missed in 692d36d779192f32371f7f9daa845b566f26968d. It's not
strictly necessary as the GC will clean it anyway, but it's good to
pre-emptively gc_free() all the blocks used in lexing/parsing.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/lexer.c')
-rw-r--r-- | py/lexer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/py/lexer.c b/py/lexer.c index ba118c9d2f..69c7d14a77 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -878,6 +878,9 @@ void mp_lexer_free(mp_lexer_t *lex) { if (lex) { lex->reader.close(lex->reader.data); vstr_clear(&lex->vstr); + #if MICROPY_PY_FSTRINGS + vstr_clear(&lex->fstring_args); + #endif m_del(uint16_t, lex->indent_level, lex->alloc_indent_level); m_del_obj(mp_lexer_t, lex); } |