mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-04 23:52:55 +08:00
implement marshalValueList more safely
copy the value, since we don't own the reference
This commit is contained in:
@@ -258,9 +258,16 @@ func marshalValueArray(p unsafe.Pointer) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func marshalValueList(p unsafe.Pointer) (interface{}, error) {
|
func marshalValueList(p unsafe.Pointer) (interface{}, error) {
|
||||||
val := glib.ValueFromNative(p)
|
value := glib.ValueFromNative(p)
|
||||||
out := ValueListValue(*glib.ValueFromNative(unsafe.Pointer(val)))
|
|
||||||
return &out, nil
|
// must copy since we don't own the gvalue passed into this marshal
|
||||||
|
out, err := value.Copy()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return (*ValueListValue)(out), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func marshalInt64Range(p unsafe.Pointer) (interface{}, error) {
|
func marshalInt64Range(p unsafe.Pointer) (interface{}, error) {
|
||||||
|
Reference in New Issue
Block a user