10000 py/lexer: Clear fstring_args vstr on lexer free. · micropython/micropython@5555f14 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5555f14

Browse files
jimmodpgeorge
authored andcommitted
py/lexer: Clear fstring_args vstr on lexer free.
This was missed in 692d36d. 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>
1 parent 44818d1 commit 5555f14

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

py/lexer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,9 @@ void mp_lexer_free(mp_lexer_t *lex) {
878878
if (lex) {
879879
lex->reader.close(lex->reader.data);
880880
vstr_clear(&lex->vstr);
881+
#if MICROPY_PY_FSTRINGS
882+
vstr_clear(&lex->fstring_args);
883+
#endif
881884
m_del(uint16_t, lex->indent_level, lex->alloc_indent_level);
882885
m_del_obj(mp_lexer_t, lex);
883886
}

0 commit comments

Comments
 (0)
0