[ncvisual] detach from sprite in ncvisual_destroy()

pull/1499/head
nick black 4 years ago
parent 89734a2dc7
commit 3c4d25a092
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -47,10 +47,14 @@ void sprixel_hide(sprixel* s){
s->invalidated = SPRIXEL_HIDE;
s->movedfromy = ncplane_abs_y(s->n);
s->movedfromx = ncplane_abs_x(s->n);
s->ncv->spx = NULL;
s->ncv = NULL;
s->n->sprite = NULL;
s->n = NULL;
if(s->ncv){
s->ncv->spx = NULL;
s->ncv = NULL;
}
if(s->n){
s->n->sprite = NULL;
s->n = NULL;
}
}
}

@ -713,6 +713,9 @@ ncvisual* ncvisual_from_plane(const ncplane* n, ncblitter_e blit, int begy, int
}
void ncvisual_destroy(ncvisual* ncv){
if(ncv->spx){
ncv->spx->ncv = NULL;
}
if(visual_implementation){
visual_implementation->visual_destroy(ncv);
}

Loading…
Cancel
Save