< index
< 13. Path finding
< 13.3 Reading path information

=====================================
13.4 Destroying a path
=====================================

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

C++ : TCODPath::~TCODPath()
C   : void TCOD_path_delete(TCOD_path_t path)
Py  : path_delete(path)

ParameterDescription
pathIn the C version, the path handler returned by one of the TCOD_path_new_* function.

Example :

C++ : TCODPath *path = new TCODPath(myMap); // allocate the path
      // use the path...
      delete path; // destroy the path
C   : TCOD_path_t path = TCOD_path_new_using_map(my_map);
      /* use the path ... */
      TCOD_path_delete(path);
Py  : path = libtcod.path_new_using_map(my_map)
      # use the path ... 
      libtcod.path_delete(path)

insert a comment