mirror of
https://github.com/go-gst/go-gst.git
synced 2025-09-27 12:22:14 +08:00
correctly borrow the promise answer
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user