< index < 5. Image toolkit | ===================================== 5.12 Deleting an image ===================================== |

You can destroy an image and release used resources with :

    C++ : TCODImage::~TCODImage()
    C   : void TCOD_image_delete(TCOD_image_t image)
    Py  : image_delete(image)

Parameter | Description
--- | ---
image | In the C version, the image handler, obtained with the load function.

Example :

    C++ : TCODImage *pix = new TCODImage(80,50);
          // ... use pix
          delete pix;
    C   : TCOD_image_t pix = TCOD_image_new(80,50);
          /* ... use pix */
          TCOD_image_delete(pix);
    Py  : pix = libtcod.image_new(80,50)
          # ... use pix
          libtcod.image_delete(pix)