xray: kill subplane when done

pull/217/head
nick black 5 years ago
parent 43e0cb3d30
commit e8064f717b
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -9,7 +9,7 @@
#include <sys/eventfd.h> #include <sys/eventfd.h>
#include "demo.h" #include "demo.h"
#define INITIAL_TABLET_COUNT 2 #define INITIAL_TABLET_COUNT 4
// FIXME ought just be an unordered_map // FIXME ought just be an unordered_map
typedef struct tabletctx { typedef struct tabletctx {

@ -13,6 +13,8 @@ static const char* leg[] = {
" 888P ", " 888P ",
}; };
static struct ncplane* killme; // FIXME
static int static int
perframecb(struct notcurses* nc, struct ncvisual* ncv __attribute__ ((unused))){ perframecb(struct notcurses* nc, struct ncvisual* ncv __attribute__ ((unused))){
static struct ncplane* n = NULL; static struct ncplane* n = NULL;
@ -30,6 +32,7 @@ perframecb(struct notcurses* nc, struct ncvisual* ncv __attribute__ ((unused))){
if(n == NULL){ if(n == NULL){
return -1; return -1;
} }
killme = n;
} }
ncplane_dim_yx(n, &dimy, &dimx); ncplane_dim_yx(n, &dimy, &dimx);
y = 0; y = 0;
@ -106,5 +109,6 @@ int xray_demo(struct notcurses* nc){
ncvisual_stream(nc, ncv, &averr, perframecb); ncvisual_stream(nc, ncv, &averr, perframecb);
ncvisual_destroy(ncv); ncvisual_destroy(ncv);
ncplane_destroy(n); ncplane_destroy(n);
ncplane_destroy(killme);
return 0; return 0;
} }

Loading…
Cancel
Save