[gdal-dev] copying a GDALColorTable

David Strip gdal at stripfamily.net
Sun Nov 11 10:58:01 PST 2012


On 11/11/2012 11:22 AM, Even Rouault wrote:
> Le dimanche 11 novembre 2012 19:16:30, David Strip a écrit :
>> If I'm reading the docs right, there is no copy constructor or
>> assignment operator for a GDALColorTable.
>> If I use GDALColorTable::clone(), how do release the copy when I'm done?
>> Do I use CPLFree or can I use delete?
> delete should work, but the preferred way would be GDALDestroyColorTable() to
> avoid potential cross-heap issues on Windows in case your code and GDAL aren't
> built with the same compiler / compiler options.
>

Thanks for a really prompt response. Perhaps the c++ class docs for 
clone() could be updated to reflect this.
And if I'm correct the call would be 
GDALDestroyColorTable((GDALColorTableH) pColorTable), casting the c++ 
pointer to a handle?



More information about the gdal-dev mailing list