# HG changeset patch # User Matti Hamalainen # Date 1288740819 -7200 # Node ID 0720ca51673e27e65c63ec5d5f293ef78b376f93 # Parent e8f67e344aaf160321ee4ae4c6bd7afd1fbdfc0e Plug some minor "memory leaks" related to curses. diff -r e8f67e344aaf -r 0720ca51673e nnchat.c --- a/nnchat.c Wed Nov 03 00:03:20 2010 +0200 +++ b/nnchat.c Wed Nov 03 01:33:39 2010 +0200 @@ -673,6 +673,12 @@ return result ? 0 : -1; } +void closeWindows(void) +{ + if (mainWin) delwin(mainWin); + if (statusWin) delwin(statusWin); + if (editWin) delwin(editWin); +} BOOL initializeWindows(void) { @@ -680,9 +686,7 @@ getmaxyx(stdscr, h, w); - if (mainWin) delwin(mainWin); - if (statusWin) delwin(statusWin); - if (editWin) delwin(editWin); + closeWindows(); mainWin = newwin(h - 4, w, 0, 0); statusWin = newwin(1, w, h - 4, 0); @@ -1275,6 +1279,7 @@ if (cursesInit) { if (curVis != ERR) curs_set(curVis); + closeWindows(); endwin(); THMSG(1, "NCurses deinitialized.\n"); }