curses status cleanup
Stop the last of the memory leaks occuring during basic usage.
This commit is contained in:
@@ -181,7 +181,7 @@ extern void curses_del_menu(winid wid);
|
||||
/* cursstat.c */
|
||||
|
||||
extern void curses_status_init(void);
|
||||
extern void curses_teardown_status(void);
|
||||
extern void curses_status_finish(void);
|
||||
extern void curses_status_update(int, genericptr_t, int, int, int,
|
||||
unsigned long *);
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ struct window_procs curses_procs = {
|
||||
genl_getmsghistory,
|
||||
genl_putmsghistory,
|
||||
curses_status_init,
|
||||
genl_status_finish,
|
||||
curses_status_finish,
|
||||
genl_status_enablefield,
|
||||
curses_status_update,
|
||||
genl_can_suspend_yes,
|
||||
|
||||
@@ -58,15 +58,16 @@ curses_status_init()
|
||||
}
|
||||
|
||||
void
|
||||
curses_teardown_status()
|
||||
curses_status_finish()
|
||||
{
|
||||
#ifdef STATUS_HILITES
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAXBLSTATS; ++i) {
|
||||
free(status_vals_long[i]);
|
||||
status_vals_long[i] = (char *) 0;
|
||||
if (status_vals_long[i])
|
||||
free(status_vals_long[i]), status_vals_long[i] = (char *) 0;
|
||||
}
|
||||
genl_status_finish();
|
||||
#endif /* STATUS_HILITES */
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -313,9 +313,7 @@ curses_del_nhwin(winid wid)
|
||||
return;
|
||||
}
|
||||
if (wid == MESSAGE_WIN) {
|
||||
curses_teardown_messages();
|
||||
} else if (wid == STATUS_WIN) {
|
||||
curses_teardown_status();
|
||||
curses_teardown_messages();
|
||||
}
|
||||
nhwins[wid].curwin = NULL;
|
||||
nhwins[wid].nhwin = -1;
|
||||
|
||||
Reference in New Issue
Block a user