[gdal-dev] Deleting GDALColorTable *

Even Rouault even.rouault at mines-paris.org
Mon Nov 26 12:13:32 PST 2012


Le lundi 26 novembre 2012 20:51:53, David Strip a écrit :
> If I do something like this:
>      GDALColorTable * ct = raster_band->GetColorTable()->clone();
>      ... bunch of stuff
>      delete ct;
> 
> Will the destructor be called on the color table represented pointed to
> by ct, or do I have to call GDALDestroyColorTable((GDALColorTableH) ct)

If GDAL and your code are built with the same VC flags, then using delete is 
OK.

GDALDestroyColorTable((GDALColorTableH) ct) will work in all cases.

> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list