rebuild: only free auxvec for non-animation #1895

This commit is contained in:
nick black 2021-07-07 01:36:34 -04:00 committed by Nick Black
parent 811bc9eb65
commit 6d6f69a02b
4 changed files with 7 additions and 4 deletions

View File

@ -705,9 +705,11 @@ sprite_rebuild(const notcurses* nc, sprixel* s, int ycell, int xcell){
uint8_t* auxvec = s->n->tam[idx].auxvector;
assert(auxvec);
ret = nc->tcache.pixel_rebuild(s, ycell, xcell, auxvec);
if(ret > 0){
free(auxvec);
s->n->tam[idx].auxvector = NULL;
}
}
// don't upset SPRIXEL_MOVED
if(s->invalidated == SPRIXEL_QUIESCENT){
if(s->n->tam[idx].state != SPRIXCELL_TRANSPARENT &&

View File

@ -332,7 +332,7 @@ int kitty_rebuild(sprixel* s, int ycell, int xcell, uint8_t* auxvec){
if(--targy == 0){
s->n->tam[s->dimx * ycell + xcell].state = state;
s->invalidated = SPRIXEL_INVALIDATED;
return 0;
return 1;
}
thisrow = targx;
//fprintf(stderr, "BUMP IT: %d %d %d %d\n", nextpixel, s->pixx, targx, chomped);

View File

@ -914,7 +914,7 @@ int sixel_rebuild(sprixel* s, int ycell, int xcell, uint8_t* auxvec){
newstate = SPRIXCELL_OPAQUE_SIXEL;
}
s->n->tam[s->dimx * ycell + xcell].state = newstate;
return 0;
return 1;
}
// 80 (sixel scrolling) is enabled by default. 8452 is not. XTSAVE/XTRESTORE

View File

@ -148,6 +148,7 @@ wipebitmap(struct notcurses* nc){
int main(void){
struct notcurses_options opts = {
.loglevel = NCLOGLEVEL_TRACE,
};
struct notcurses* nc = notcurses_core_init(&opts, NULL);
if(notcurses_check_pixel_support(nc) < 1){