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()
|
p.next()
|
||||||
defer {
|
defer {
|
||||||
strwr.free()
|
unsafe { strwr.free() }
|
||||||
}
|
}
|
||||||
str := strwr.str()
|
str := strwr.str()
|
||||||
return Any(str)
|
return Any(str)
|
||||||
|
|
|
@ -30,7 +30,7 @@ pub fn (flds map[string]Any) str() string {
|
||||||
}
|
}
|
||||||
wr.write_b(`}`)
|
wr.write_b(`}`)
|
||||||
defer {
|
defer {
|
||||||
wr.free()
|
unsafe { wr.free() }
|
||||||
}
|
}
|
||||||
res := wr.str()
|
res := wr.str()
|
||||||
return res
|
return res
|
||||||
|
@ -45,7 +45,7 @@ pub fn (flds []Any) str() string {
|
||||||
}
|
}
|
||||||
wr.write_b(`]`)
|
wr.write_b(`]`)
|
||||||
defer {
|
defer {
|
||||||
wr.free()
|
unsafe { wr.free() }
|
||||||
}
|
}
|
||||||
res := wr.str()
|
res := wr.str()
|
||||||
return res
|
return res
|
||||||
|
|
Loading…
Reference in New Issue