golang C.CString 必須Free

cs := C.CString("PN")
Proc_op2_object_get_string.Call(uintptr(unsafe.Pointer(pt)), uintptr(unsafe.Pointer(cs)), uintptr(unsafe.Pointer(&buf_PN[0])), uintptr(len(buf_PN)))
C.free(unsafe.Pointer(cs))

不然會致使內存泄漏ui

相關文章
相關標籤/搜索