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.
dankamongmen/ltr
nick black 4 years ago
parent a7f59e4fab
commit 9b7238fdc9
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

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

Loading…
Cancel
Save