glycerine / zygomys

Zygo is a Lisp interpreter written in 100% Go. Central use case: dynamically compose Go struct trees in a zygo script, then invoke compiled Go functions on those trees. Makes Go reflection easy.
https://github.com/glycerine/zygomys/wiki
BSD 2-Clause "Simplified" License
1.71k stars 81 forks source link

fix resource leak in repl #63

Closed jt0404 closed 5 months ago

jt0404 commented 5 months ago

When starting CpuProfile fails with error you exit the program but don't close the file. This PR fixes it.

glycerine commented 5 months ago

https://unix.stackexchange.com/questions/430365/what-happens-to-file-descriptors-when-the-process-is-killed

os.Exit() closes the file, in that the operating system closes any open files on process termination.