jung-kurt / gofpdf

A PDF document generator with high level support for text, drawing and images
http://godoc.org/github.com/jung-kurt/gofpdf
MIT License
4.33k stars 782 forks source link

Add clean to Fpdf #321

Closed Antonboom closed 4 years ago

Antonboom commented 5 years ago

Hello! Do you think this is enough or are there pitfalls?

Experimentally revealed that this only works with a calls

Probably have to take out the generation of PDF in a separate service :)

jung-kurt commented 5 years ago

Do you think this is enough or are there pitfalls?

Good question. If a call to GC is needed, I wonder if it is sufficient to simply set the *Fpdf instance to nil and then call GC().

jung-kurt commented 4 years ago

This change causes a panic with TestIssue0316:

panic: assignment to entry in nil map [recovered] panic: assignment to entry in nil map

I will close this PR until we know for sure that this kind of garbage collection hint can be done safely and that the initial problem is not, in fact, the calling service's problem. Feel free to reopen if you can show otherwise. Your interest is appreciated.