Increment reference count for results in genMethodBody.

This commit is contained in:
Lance Hartung 2016-01-04 15:33:27 -06:00
parent c3392d2400
commit b5e44cd754
1 changed files with 7 additions and 0 deletions

View File

@ -451,6 +451,13 @@ func (g *goGen) genMethodBody(s Struct, m Func) {
return
}
for i, res := range results {
if !res.needWrap() {
continue
}
g.Printf("cgopy_incref(unsafe.Pointer(&_gopy_%03d))\n", i)
}
g.Printf("return ")
for i, res := range results {
if i > 0 {