< index < 12. Field of view toolkit < 12.3 Reading fov information | ===================================== 12.4 Destroying a map ===================================== |

To release the resources used by a map, destroy it with :

    C++ : TCODMap::~TCODMap()
    C   : void TCOD_map_delete(TCOD_map_t map)
    Py  : map_delete(map)

Parameter | Description
--- | ---
map | In the C version, the map handler returned by the TCOD_map_new function.

Example :

    C++ : TCODMap *map = new TCODMap(50,50); // allocate the map
          map->setCanSeeThrough(10,10,true); // set a cell as 'empty'
          map->computeFov(10,10); // calculate fov from the cell 10x10
    	  bool visible=map->isInFov(10,10); // is the cell 10x10 visible ?
    	  delete map; // destroy the map
    C   : TCOD_map_t map = TCOD_map_new(50,50);
          TCOD_map_set_can_see_through(map,10,10,true);
          TCOD_map_compute_fov(map,10,10);
          bool visible = TCOD_map_is_in_fov(map,10,10);
          TCOD_map_delete(map);
    Py  : map = litbcod.map_new(50,50)
          litbcod.map_set_can_see_through(map,10,10,True)
          litbcod.map_compute_fov(map,10,10)
          visible = litbcod.map_is_in_fov(map,10,10)
          litbcod.map_delete(map)