vweb: fix a template leak

pull/5606/head
Alexander Medvednikov 2020-07-01 17:04:30 +02:00
parent e78dc4d682
commit 5de0f944bd
2 changed files with 3 additions and 3 deletions

View File

@ -115,9 +115,9 @@ pub fn (mut b Builder) str() string {
}
b.buf << `\0`
s := string(b.buf,b.len)
//bis := b.initial_size
bis := b.initial_size
//free(b.buf.data)
//b.buf = []byte{cap: bis}
b.buf = []byte{cap: bis}
b.len = 0
return s
}

View File

@ -21,7 +21,7 @@ fn (g &Gen) comptime_call(node ast.ComptimeCall) {
}
}
}
g.writeln('vweb__Context_html(&app->vweb, _tmpl_res_$g.fn_decl.name); string_free(&_tmpl_res_$g.fn_decl.name);')
g.writeln('vweb__Context_html(&app->vweb, _tmpl_res_$g.fn_decl.name); strings__Builder_free(&sb); string_free(&_tmpl_res_$g.fn_decl.name);')
return
}
g.writeln('// $' + 'method call. sym="$node.sym.name"')