It is not necessarily the open doc that is freeing the memory, could be the close doc as well - meaning it needs the file and opt reference while it is open. Probably not file, but possible opt. The other thing are you sure that the opt doesn’t contain a reference that is freed to early...
> On Oct 11, 2018, at 6:57 AM, ndav...@turnitin.com wrote: > > Hi, > > That was at least a working theory there for a while; that perhaps the open > document was doing some freeing of the memory before it returned. The reason > we discounted that was some docs the defer func() free works fine. It could > be a weird bug in that library, and I'm still considering that option :) What > moved us away from that is that when we had the defer func() approach a > certain set of docs failed every time with this issue. Move to the code we > have now and all those docs work as expected. > > It's a really odd one. I'm ok with the code as it is now. I just would like > to understand some more. Thanks for taking a look and for asking questions. > Please keep doing so, you never know we may get to the bottom of this. > > Thanks > Nathan > >>> > > -- > 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. -- 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.