mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
autofree: do not free tmp vars twice
This commit is contained in:
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
Block a user