diff --git a/src/lib/internal.h b/src/lib/internal.h index 5a830dc5b..5a7cc9c5e 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -726,6 +726,7 @@ destroy_tam(ncplane* p){ if(p->tam){ cleanup_tam(p->tam, p->leny, p->lenx); free(p->tam); + p->tam = NULL; } } diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 283457adf..0c8a0b38d 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -2170,6 +2170,7 @@ void ncplane_erase(ncplane* n){ loginfo("erasing plane\n"); if(n->sprite){ sprixel_hide(n->sprite); + destroy_tam(n); } // we must preserve the background, but a pure nccell_duplicate() would be // wiped out by the egcpool_dump(). do a duplication (to get the stylemask