correctly borrow the promise answer

This commit is contained in:
RSWilli
2025-09-19 14:09:33 +02:00
parent 514902751a
commit d3d7af92d7

View File

@@ -271,6 +271,9 @@ func (promise *Promise) GetReply() *Structure {
if cret != nil {
goret = UnsafeStructureFromGlibNone(unsafe.Pointer(cret))
// the returned Structure is borrowed, so keep the promise alive:
runtime.AddCleanup(goret, func(_ *Promise) {}, promise)
}
return goret