ncplane_destroy(): pull it out of the zbuffer #26

pull/68/head
nick black 5 years ago
parent 01beeb07b8
commit 2dde60c27a
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -372,14 +372,24 @@ ncplane* notcurses_newplane(notcurses* nc, int rows, int cols,
}
int ncplane_destroy(notcurses* nc, ncplane* ncp){
if(ncp){
if(ncp == NULL){
return 0;
}
if(nc->stdscr == ncp){
return -1;
}
// FIXME close it up
}
ncplane** above;
// pull it out of the list
for(above = &nc->top ; *above ; above = &(*above)->z){
if(*above == ncp){
*above = ncp->z;
free_plane(ncp);
return 0;
}
}
// couldn't find it in our stack. don't try to free this interloper.
return -1;
}
static int
interrogate_terminfo(notcurses* nc, const notcurses_options* opts){

Loading…
Cancel
Save