< index < 9. Pseudorandom number generator < 9.2 Using a generator | ===================================== 9.3 Destroying a generator ===================================== |

### TCODRandom::~TCODRandom

To release ressources used by a generator, use those functions :
NB : do not delete the default random generator !

    C++ : TCODRandom::~TCODRandom()
    C   : void TCOD_random_delete(TCOD_random_t mersenne)
    Py  : random_delete(mersenne)

Parameter | Description
--- | ---
mersenne | In the C version, the generator handler, returned by the initialization functions.

Example :

    C++ : // create a generator
          TCODRandom *rnd = new TCODRandom();
          // use it
          ...
          // destroy it
          delete rnd;
    C   : /* create a generator */
          TCOD_random_t rnd = TCOD_random_new();
          /* use it */
          ...
          /* destroy it */
          TCOD_random_delete(rnd);
    Py  : # create a generator
          rnd = libtcod.random_new()
          # use it
          ...
          # destroy it
          libtcod.random_delete(rnd)