Skip to content

Commit

Permalink
Merge pull request #350 from EvanOman/fix-handleFromPtr-missing-refer…
Browse files Browse the repository at this point in the history
…ence

Fix `handleFromPtr` missing Reference in Maps
  • Loading branch information
rcoreilly authored Apr 22, 2024
2 parents d520eb6 + 6079a4c commit 90afd80
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bind/gen_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,14 @@ otherwise parameter is a python list that we copy from
g.gofile.Outdent()
g.gofile.Printf("}\n")
if esym.go2py != "" {
g.gofile.Printf("return %s(v)%s\n", esym.go2py, esym.go2pyParenEx)
// If the go2py starts with handleFromPtr_, use &v, otherwise just v
val_str := ""
if strings.HasPrefix(esym.go2py, "handleFromPtr_") {
val_str = "&v"
} else {
val_str = "v"
}
g.gofile.Printf("return %s(%s)%s\n", esym.go2py, val_str, esym.go2pyParenEx)
} else {
g.gofile.Printf("return v\n")
}
Expand Down

0 comments on commit 90afd80

Please sign in to comment.