demo: preserve plot/hud/etc. on shutdown

If we're using -k to inhibit use of the alternate screen
for notcurses-demo, we want to see what was on the screen
when we quit. If we're actually quitting, don't destroy
these components manually, so they remain visible.
This commit is contained in:
nick black 2020-12-06 03:06:02 -05:00
parent a7f59e4fab
commit 9b7238fdc9
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -584,6 +584,7 @@ int main(int argc, char** argv){
if(ext_demos(nc, spec, ignore_failures)){ if(ext_demos(nc, spec, ignore_failures)){
goto err; goto err;
} }
if(restart_demos){
if(hud_destroy()){ // destroy here since notcurses_drop_planes will kill it if(hud_destroy()){ // destroy here since notcurses_drop_planes will kill it
goto err; goto err;
} }
@ -591,6 +592,7 @@ int main(int argc, char** argv){
goto err; goto err;
} }
about_destroy(nc); about_destroy(nc);
}
}while(restart_demos); }while(restart_demos);
ncmenu_destroy(menu); ncmenu_destroy(menu);
if(stop_input()){ if(stop_input()){