json2: wrap Builder.free() calls inside unsafe (#8790)
parent
2002d20249
commit
e4a67dea37
|
@ -311,7 +311,7 @@ fn (mut p Parser) decode_string() ?Any {
|
|||
}
|
||||
p.next()
|
||||
defer {
|
||||
strwr.free()
|
||||
unsafe { strwr.free() }
|
||||
}
|
||||
str := strwr.str()
|
||||
return Any(str)
|
||||
|
|
|
@ -30,7 +30,7 @@ pub fn (flds map[string]Any) str() string {
|
|||
}
|
||||
wr.write_b(`}`)
|
||||
defer {
|
||||
wr.free()
|
||||
unsafe { wr.free() }
|
||||
}
|
||||
res := wr.str()
|
||||
return res
|
||||
|
@ -45,7 +45,7 @@ pub fn (flds []Any) str() string {
|
|||
}
|
||||
wr.write_b(`]`)
|
||||
defer {
|
||||
wr.free()
|
||||
unsafe { wr.free() }
|
||||
}
|
||||
res := wr.str()
|
||||
return res
|
||||
|
|
Loading…
Reference in New Issue