mirror of
https://github.com/go-gst/go-gst.git
synced 2025-09-26 20:11:18 +08:00
unreference cstring created when calling gst_tag_list_to_string which caused a memory leak
This commit is contained in:

committed by
RMarchante

parent
77c0c3181b
commit
2ae8e7ee75
@@ -70,7 +70,11 @@ func NewTagListFromString(tags string) *TagList {
|
||||
func (t *TagList) Instance() *C.GstTagList { return C.toGstTagList(unsafe.Pointer(t.ptr)) }
|
||||
|
||||
// String implements a stringer on the TagList and serializes it to a string.
|
||||
func (t *TagList) String() string { return C.GoString(C.gst_tag_list_to_string(t.Instance())) }
|
||||
func (t *TagList) String() string {
|
||||
cStr := C.gst_tag_list_to_string(t.Instance())
|
||||
defer C.g_free((C.gpointer)(unsafe.Pointer(cStr)))
|
||||
return C.GoString(cStr)
|
||||
}
|
||||
|
||||
// Ref increases the ref count on this TagList by one.
|
||||
func (t *TagList) Ref() *TagList { return wrapTagList(C.gst_tag_list_ref(t.Instance())) }
|
||||
|
Reference in New Issue
Block a user