demo: fpsgraph_init: ncuplot_create() kills plane on error

pull/1706/head
nick black 3 years ago
parent 74eac6236b
commit 1f1bbadeac
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -667,9 +667,9 @@ int fpsgraph_init(struct notcurses* nc){
ncchannels_set_fg_rgb8(&opts.maxchannels, 0x80, 0xff, 0x80);
ncchannels_set_bg_rgb(&opts.maxchannels, 0x201020);
ncchannels_set_bg_alpha(&opts.maxchannels, CELL_ALPHA_BLEND);
// takes ownership of newp on all paths
struct ncuplot* fpsplot = ncuplot_create(newp, &opts, 0, 0);
if(!fpsplot){
ncplane_destroy(newp);
return EXIT_FAILURE;
}
plot = fpsplot;

Loading…
Cancel
Save