Remove a long-standing window leak I just noticed.

This commit is contained in:
Jordan K. Hubbard 1996-04-18 13:36:39 +00:00
parent c50c22c798
commit 806a609d46
3 changed files with 18 additions and 2 deletions

View File

@ -206,7 +206,6 @@ dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int wi
save = dupwin(newscr);
st = ditems[OK_BUTTON].fire(&ditems[OK_BUTTON]);
delwin(dialog);
if (st & DITEM_RESTORE) {
touchwin(save);
wrefresh(save);
@ -214,7 +213,6 @@ dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int wi
delwin(save);
}
else {
delwin(dialog);
*result = '\0';
for (i = 0; i < item_no; i++) {
if (status[i]) {
@ -223,6 +221,8 @@ dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int wi
}
}
}
delwin(list);
delwin(dialog);
return 0;
}
/* Shortcut to cancel? */
@ -239,6 +239,7 @@ dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int wi
}
delwin(save);
}
delwin(list);
delwin(dialog);
return 1;
}
@ -329,6 +330,7 @@ dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int wi
}
else if (st & DITEM_RECREATE) {
delwin(save);
delwin(list);
delwin(dialog);
goto draw;
}
@ -468,6 +470,7 @@ dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int wi
}
}
}
delwin(list);
delwin(dialog);
return button;
break;
@ -493,6 +496,7 @@ dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int wi
redraw_menu = FALSE;
}
}
delwin(list);
delwin(dialog);
return -1; /* ESC pressed */
}

View File

@ -143,6 +143,7 @@ dialog_menu(unsigned char *title, unsigned char *prompt, int height, int width,
/* create new window for the menu */
menu = subwin(dialog, menu_height, menu_width, y + box_y + 1, x + box_x + 1);
if (menu == NULL) {
delwin(dialog);
endwin();
fprintf(stderr, "\nsubwin(dialog,%d,%d,%d,%d) failed, maybe wrong dims\n", menu_height,menu_width,y+box_y+1,x+box_x+1);
return -1;
@ -202,6 +203,7 @@ dialog_menu(unsigned char *title, unsigned char *prompt, int height, int width,
}
else
strcpy(result, items[(scroll + choice) * 2]);
delwin(menu);
delwin(dialog);
return 0;
}
@ -219,6 +221,7 @@ dialog_menu(unsigned char *title, unsigned char *prompt, int height, int width,
}
delwin(save);
}
delwin(menu);
delwin(dialog);
return 1;
}
@ -385,6 +388,7 @@ dialog_menu(unsigned char *title, unsigned char *prompt, int height, int width,
wrefresh(save);
}
else if (status & DITEM_RECREATE) {
delwin(menu);
delwin(dialog);
delwin(save);
goto draw;
@ -396,6 +400,7 @@ dialog_menu(unsigned char *title, unsigned char *prompt, int height, int width,
else if (result)
strcpy(result, items[(scroll+choice)*2]);
}
delwin(menu);
delwin(dialog);
return button;
@ -420,6 +425,7 @@ dialog_menu(unsigned char *title, unsigned char *prompt, int height, int width,
}
}
delwin(menu);
delwin(dialog);
return -1; /* ESC pressed */
}

View File

@ -230,6 +230,7 @@ dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int wi
}
}
}
delwin(list);
delwin(dialog);
return 0;
}
@ -247,6 +248,7 @@ dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int wi
}
delwin(save);
}
delwin(list);
delwin(dialog);
return 1;
}
@ -335,6 +337,7 @@ dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int wi
}
else if (st & DITEM_RECREATE) {
delwin(save);
delwin(list);
delwin(dialog);
goto draw;
}
@ -460,6 +463,7 @@ dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int wi
}
else if (st & DITEM_RECREATE) {
delwin(save);
delwin(list);
delwin(dialog);
goto draw;
}
@ -475,6 +479,7 @@ dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int wi
}
}
}
delwin(list);
delwin(dialog);
return button;
break;
@ -499,6 +504,7 @@ dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int wi
}
}
delwin(list);
delwin(dialog);
free(status);
return -1; /* ESC pressed */