|
|
@ -1187,16 +1187,25 @@ err:
|
|
|
|
// updates *pile to point at (*pile)->next, frees all but standard pile/plane
|
|
|
|
// updates *pile to point at (*pile)->next, frees all but standard pile/plane
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
ncpile_drop(notcurses* nc, ncpile** pile){
|
|
|
|
ncpile_drop(notcurses* nc, ncpile** pile){
|
|
|
|
|
|
|
|
bool sawstdplane = false;
|
|
|
|
ncpile* next = (*pile)->next;
|
|
|
|
ncpile* next = (*pile)->next;
|
|
|
|
ncplane* p = (*pile)->top;
|
|
|
|
ncplane* p = (*pile)->top;
|
|
|
|
while(p){
|
|
|
|
while(p){
|
|
|
|
ncplane* tmp = p->below;
|
|
|
|
ncplane* tmp = p->below;
|
|
|
|
if(nc->stdplane != p){
|
|
|
|
if(nc->stdplane != p){
|
|
|
|
free_plane(p);
|
|
|
|
free_plane(p);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
sawstdplane = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
p = tmp;
|
|
|
|
p = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*pile = next;
|
|
|
|
*pile = next;
|
|
|
|
|
|
|
|
if(sawstdplane){
|
|
|
|
|
|
|
|
ncplane_pile(nc->stdplane)->top = nc->stdplane;
|
|
|
|
|
|
|
|
ncplane_pile(nc->stdplane)->bottom = nc->stdplane;
|
|
|
|
|
|
|
|
nc->stdplane->above = nc->stdplane->below = NULL;
|
|
|
|
|
|
|
|
nc->stdplane->blist = NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// drop all piles and all planes, save the standard plane and its pile
|
|
|
|
// drop all piles and all planes, save the standard plane and its pile
|
|
|
@ -1208,9 +1217,6 @@ void notcurses_drop_planes(notcurses* nc){
|
|
|
|
ncpile_drop(nc, &p);
|
|
|
|
ncpile_drop(nc, &p);
|
|
|
|
}while(p0 != p);
|
|
|
|
}while(p0 != p);
|
|
|
|
pthread_mutex_unlock(&nc->pilelock);
|
|
|
|
pthread_mutex_unlock(&nc->pilelock);
|
|
|
|
ncplane_pile(nc->stdplane)->top = nc->stdplane;
|
|
|
|
|
|
|
|
ncplane_pile(nc->stdplane)->bottom = nc->stdplane;
|
|
|
|
|
|
|
|
nc->stdplane->above = nc->stdplane->below = NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int notcurses_stop(notcurses* nc){
|
|
|
|
int notcurses_stop(notcurses* nc){
|
|
|
|