1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: check is ptr when free in closing scope (#1399)

This commit is contained in:
Henrixounez 2019-07-31 19:21:49 +02:00 committed by Alexander Medvednikov
parent 37a0e6ebef
commit 715bd21118

View File

@ -1029,7 +1029,7 @@ fn (p mut Parser) close_scope() {
else if v.typ == 'string' {
p.genln('v_string_free($v.name); // close_scope free')
}
else {
else if v.ptr {
p.genln('free($v.name); // close_scope free')
}
}