Free windows on exit

This commit is contained in:
James Booth
2013-08-26 17:47:29 +01:00
parent 18d11f2bcf
commit bca379844d
4 changed files with 13 additions and 2 deletions

View File

@@ -135,6 +135,7 @@ void
ui_close(void) ui_close(void)
{ {
notifier_uninit(); notifier_uninit();
wins_destroy();
endwin(); endwin();
} }

View File

@@ -57,8 +57,6 @@ win_free(ProfWin* window)
{ {
delwin(window->win); delwin(window->win);
free(window->from); free(window->from);
window->from = NULL;
window->win = NULL;
free(window); free(window);
window = NULL; window = NULL;
} }

View File

@@ -455,3 +455,14 @@ wins_create_summary(void)
return result; return result;
} }
void
wins_destroy(void)
{
int i;
for (i = 0; i < NUM_WINS; i++) {
if (windows[i] != NULL) {
win_free(windows[i]);
}
}
}

View File

@@ -47,5 +47,6 @@ GSList * wins_get_prune_recipients(void);
void wins_lost_connection(void); void wins_lost_connection(void);
gboolean wins_tidy(void); gboolean wins_tidy(void);
GSList * wins_create_summary(void); GSList * wins_create_summary(void);
void wins_destroy(void);
#endif #endif