Fix chunk unload memory leak

isolation_bkp/dynres
Dominik Madarász 2021-09-20 11:27:47 +02:00
parent 21ca700626
commit 9542324811
2 changed files with 4 additions and 2 deletions

View File

@ -102,5 +102,5 @@ void entity_view_update_chunk_texture(entity_view_tbl *map, uint64_t ent_id, voi
void entity_view_remove_chunk_texture(entity_view_tbl *map, uint64_t ent_id) {
entity_view *view = entity_view_tbl_get(map, ent_id);
if (view->kind != EKIND_CHUNK) return;
blocks_remove_chunk_tex(view->tex);
}
blocks_remove_chunk_tex(ent_id);
}

View File

@ -15,6 +15,8 @@ int32_t tracker_read_remove(librg_world *w, librg_event *e) {
} else {
entity_view_mark_for_removal(&view->entities, entity_id);
}
blocks_remove_chunk_tex(entity_id);
return 0;
}