autofree: fix stmts() free
parent
1338e7fce2
commit
7231b467a6
|
@ -623,8 +623,11 @@ fn (mut g Gen) stmts(stmts []ast.Stmt) {
|
||||||
g.write(')')
|
g.write(')')
|
||||||
}
|
}
|
||||||
if g.pref.autofree && stmts.len > 0 {
|
if g.pref.autofree && stmts.len > 0 {
|
||||||
// g.writeln('// autofree scope')
|
stmt := stmts[stmts.len - 1]
|
||||||
g.autofree_scope_vars(stmts[stmts.len - 1].position().pos)
|
if stmt !is ast.FnDecl {
|
||||||
|
// g.writeln('// autofree scope')
|
||||||
|
g.autofree_scope_vars(stmt.position().pos)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue