Hey Jake, First if all thanks for the willing to help.
Cgo is the built-in tool in go of building c libraries (see: https://golang.org/cmd/cgo/) What I basically do is that I have a go code, which i build into c library (dll), i.e, i insert the go code onto the cgo mechine then get .h and .dll on the otherside. The memory is allocated inside the .dll using C.malloc (which is basically c malloc), and i try to free it inside the cpp file which is linked to this dll. If i build a function inside the go code to free a recived pointer, which will end up in the dll, then the problem is avoided. That being said, due to the fact that I have quite a few callbacks and a large data transfer between the dll and my app i would like to keep it simple and not have to use a third function to free the mallocs, as it is also a problem if it happens the other way around, i.e., if i allocate memory in the app and try to free it inside the library. Sorry if im unclear i tried to explsin it the best as i can. Ps yes i do use windiws, a side remark is that if i use gcc this does not happen. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.