Fix memory leak of sidebar mode switcher boxes.

This commit is contained in:
QC 2015-01-04 13:24:08 +01:00
parent 4c92d1fc0c
commit 7ee64b258d
1 changed files with 10 additions and 0 deletions

View File

@ -1668,6 +1668,16 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
int retv = state.retv;
menu_free_state ( &state );
// Free the switcher boxes.
// When state is free'ed we should no longer need these.
if ( config.sidebar_mode == TRUE ) {
for ( int j = 0; j < num_switchers; j++ ) {
textbox_free ( switchers[j].tb );
switchers[j].tb = NULL;
}
}
return retv;
}