autofree: do not free tmp vars twice
parent
70cbf56655
commit
b59c5fd82b
|
@ -1971,6 +1971,9 @@ fn (mut g Gen) autofree_var_call(free_fn_name string, v ast.Var) {
|
|||
// tmp expr vars do not need to be freed again here
|
||||
return
|
||||
}
|
||||
if v.is_autofree_tmp {
|
||||
return
|
||||
}
|
||||
if v.typ.is_ptr() {
|
||||
g.writeln('\t${free_fn_name}(${c_name(v.name)}); // autofreed ptr var')
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue