Closed Ortuna closed 9 years ago
I think the free
is required.
That is also the reference I was checking. The example they give they are themselves creating the cs
variable via the C.CString
function. This should be freed (I'm assuming it was allocated by go). In font.go#L59 we get a pointer back.
(the free
on fonts.go#L60 looks good to me.) I get the crash at a defer
on fonts.go#L63. We free a pointer coming back from C.HPDF_LoadTTFontFromFile
. I'm still new to go, so I maybe totally wrong as well.
Oh, sorry. I didn't read the code.
You are right. We do not call free
for GoString
.
I've added a test for it in my other PR. I believe the
free
shouldn't be used since it's not something we are declaring dynamically?