Closed bvinc closed 9 years ago
Just back from a business trip where I was unable to respond. Will get to work on a fix as soon as I can.
If you already have something cooked up you can also submit a pull request.
Fixed in commit 0b9eb14d568638603cf85f480e273eb8fe701721
Steps to reproduce:
Expected results: The program doesn't segfault.
The reason this happens is because of SetFields on form.go line 211. It creates an array of CFIELD pointers and passes the CFIELD\ to set_form_fields. ncurses will save this pointer internally and expect that the memory will continue to be valid. However, since this is an array allocated by go, it's under the influence of the go garbage collector. After SetFields returns, it's only a matter of time before it is garbage collected, since no go pointer exists that points to this memory.