Skip to content

Segmentation Fault when referencing closed window #49

@JavaScriptDude

Description

@JavaScriptDude

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions