- These functions are used to simplify analysis of memory
- leaks in the ncurses library. They are normally not
- available; they must be configured into the library at
- build time using the <STRONG>--disable-leaks</STRONG> option. That com-
- piles-in code that frees memory that normally would not be
- freed.
-
- Any implementation of curses must not free the memory as-
- sociated with a screen, since (even after calling <STRONG>endwin</STRONG>),
- it must be available for use in the next call to <STRONG>re-</STRONG>
- <STRONG><A HREF="refresh.3x.html">fresh(3x)</A></STRONG>. There are also chunks of memory held for per-
- formance reasons. That makes it hard to analyze curses
- applications for memory leaks. To work around this, one
- can build a debugging version of the ncurses library which
- frees those chunks which it can, and provides these func-
- tions to free all of the memory allocated by the ncurses
- library.
-
- The _nc_free_and_exit function is the preferred one since
- some of the memory which is freed may be required for the
- application to continue running. Its parameter is the
- code to pass to the exit routine.
+ These functions are used to simplify analysis of memory leaks in the
+ ncurses library.
+
+ Any implementation of curses must not free the memory associated with a
+ screen, since (even after calling <STRONG>endwin</STRONG>), it must be available for use
+ in the next call to <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG>. There are also chunks of memory held
+ for performance reasons. That makes it hard to analyze curses applica-
+ tions for memory leaks. When using the specially configured debugging
+ version of the ncurses library, applications can call functions which
+ free those chunks of memory, simplifying the process of memory-leak
+ checking.
+
+ Some of the functions are named with a "_nc_" prefix because they are
+ not intended for use in the non-debugging library:
+
+ <STRONG>_nc_freeall</STRONG>
+ This frees (almost) all of the memory allocated by ncurses.
+
+ <STRONG>_nc_free_and_exit</STRONG>
+ This frees the memory allocated by ncurses (like <STRONG>_nc_freeall</STRONG>), and
+ exits the program. It is preferred over <STRONG>_nc_freeall</STRONG> since some of
+ that memory may be required to keep the application running. Sim-
+ ply exiting (with the given exit-code) is safer.
+
+ <STRONG>_nc_free_tinfo</STRONG>
+ Use this function if only the low-level terminfo functions (and
+ corresponding library) are used. Like <STRONG>_nc_free_and_exit</STRONG>, it exits
+ the program after freeing memory.
+
+ The functions prefixed "_nc" are normally not available; they must be
+ configured into the library at build time using the <STRONG>--disable-leaks</STRONG> op-
+ tion. That compiles-in code that frees memory that normally would not
+ be freed.
+
+ The <STRONG>exit_curses</STRONG> and <STRONG>exit_terminfo</STRONG> functions call <STRONG>_nc_free_and_exit</STRONG> and
+ <STRONG>_nc_free_tinfo</STRONG> if the library is configured to support memory-leak
+ checking. If the library is not configured to support memory-leak
+ checking, they simply call <STRONG>exit</STRONG>.