void gc_map(void){ int counter = 0; struct tilelist* list = map.tiles; struct tilelist* next; while(list){ counter++; next = list->next; if(counter == 100){ list->next = NULL; } else if (counter > 100) { free_tile(list->tile); free(list); } list = next; } }
static void gdal_nif_tile_resource_cleanup(ErlNifEnv* env, void* arg) { DEBUG("FrEE tile\r\n"); gdal_tile_handle* ti = (gdal_tile_handle*)arg; free_tile(ti); }