X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fpadview.c;fp=test%2Fpadview.c;h=868dbfeda2142abe051f7fa96df96e0b317afab8;hp=fb1d9fca176ee89329b7c172778f21dcfaf5c5a9;hb=1ddfa997c0965852dbdc738aa6d92c0cd0975f3b;hpb=eeac2ef5db363494c4272b6dca6d9a0474153381 diff --git a/test/padview.c b/test/padview.c index fb1d9fca..868dbfed 100644 --- a/test/padview.c +++ b/test/padview.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019-2020,2021 Thomas E. Dickey * + * Copyright 2019-2021,2022 Thomas E. Dickey * * Copyright 2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -29,7 +29,7 @@ /* * clone of view.c, using pads * - * $Id: padview.c,v 1.18 2021/06/12 23:16:31 tom Exp $ + * $Id: padview.c,v 1.19 2022/05/15 14:36:23 tom Exp $ */ #include @@ -45,6 +45,7 @@ static GCC_NORETURN void finish(int sig); #define my_pair 1 +static WINDOW *global_pad; static int shift = 0; static bool try_color = FALSE; @@ -69,6 +70,8 @@ static void finish(int sig) { endwin(); + if (global_pad != NULL) + delwin(global_pad); ExitProgram(sig != 0 ? EXIT_FAILURE : EXIT_SUCCESS); } @@ -372,7 +375,8 @@ main(int argc, char *argv[]) * Do this after starting color, otherwise the pad's background will be * uncolored after the ncurses 6.1.20181208 fixes. */ - my_pad = read_file(fname = argv[optind]); + global_pad = + my_pad = read_file(fname = argv[optind]); my_row = 0; while (!done) {