node-ncurses
node-ncurses copied to clipboard
Segmentation Fault when referencing closed window
The library will fail when calling methods of a closed ncurses window.
For example for window (w):
console.log("Calling Refresh - OK");
w.refresh();
console.log("Closing Window - OK");
w.close();
console.log("Calling Refresh again - Will cause Segmentation Fault");
w.refresh();
I understand that a developer should never do this in working code but while developing, I hit this one and its very troublesome as it gives no hint as to the reason for the failure. The failure mode I hit was with much more complex code based on playing around with code in lib/widget.js.
Is it possible few lines of code can be added to store the state of a window that is closed and add a hooks trap a closed window condition with an intuitive error message rather than the current segfault?