genbindings: return nil Qt objects as Go nil objects

This commit is contained in:
mappu 2024-09-01 14:23:31 +12:00
parent 789d530398
commit de0fb12cfe

View File

@ -327,6 +327,9 @@ import "C"
ret.WriteString(` ret.WriteString(`
func new` + goClassName + `(h *C.` + goClassName + `) *` + goClassName + ` { func new` + goClassName + `(h *C.` + goClassName + `) *` + goClassName + ` {
if h == nil {
return nil
}
return &` + goClassName + `{` + localInit + `} return &` + goClassName + `{` + localInit + `}
} }