< index < 10. Noise generator < 10.4 Getting 'turbulence' | ===================================== 10.5 Destroying a generator ===================================== |

To release ressources used by a generator, use those functions :

    C++ : TCODNoise::~TCODNoise()
    C   : void TCOD_noise_delete(TCOD_noise_t noise)
    Py  : noise_delete(noise)

Parameter | Description
--- | ---
noise | In the C version, the generator handler, returned by the initialization function.

Example :

    C++ : // create a generator
          TCODNoise *noise = new TCODNoise(2);
          // use it
          ...
          // destroy it
          delete noise;
    C   : /* create a generator */
          TCOD_noise_t noise = TCOD_noise_new(2,TCOD_NOISE_DEFAULT_HURST, TCOD_NOISE_DEFAUT_LACUNARITY, NULL);
          /* use it */
          ...
          /* destroy it */
          TCOD_noise_delete(noise);
    Py  : # create a generator
          noise = libtcod.noise_new(2,litbcod.NOISE_DEFAULT_HURST, litbcod.NOISE_DEFAUT_LACUNARITY, 0)
          # use it
          ...
          # destroy it
          litbcod.noise_delete(noise)