[Gdal-dev] OGRLayer::GetGeometryColumn & GetFIDColumn

Craig Miller craig.miller at spatialminds.com
Tue Jun 13 15:49:28 EDT 2006


Thanks for the reply.

And here is an example for all the kids on why you shouldn't be coding when
you should be in bed.  You miss those little details like "const" in the
method signatures <sigh>.  Either that, or its an example of why you should
keep the refrigerator stocked with a variety of caffeinated products.

--Craig
 

-----Original Message-----
From: gdal-dev-bounces at lists.maptools.org
[mailto:gdal-dev-bounces at lists.maptools.org] On Behalf Of Mateusz Loskot
Sent: Tuesday, June 13, 2006 4:46 AM
To: gdal-dev at lists.maptools.org
Subject: Re: [Gdal-dev] OGRLayer::GetGeometryColumn & GetFIDColumn

Craig Miller wrote:
> Hi,
> 
> I've been browsing the docs, but they are silent on this particular 
> question.  Could anyone clarify who owns the char* returned

It's not a type of char* but const char*.

> from OGRLayer::GetGeometryColumn and OGRLayer::GetFIDColumn?  E.g. 
> should I delete them when I am through with them or does the OGRLayer  
> still own them?

Client are not supposed to deallocate memory pointed by const char* returned
from those functions above. They are deallocated in OGRLayer destructor,
more precisely, in destructors of layer classes derived from OGRLayer in
particular driver.

Also, you're reading those values in read-only mode.

Cheers
--
Mateusz Loskot
http://mateusz.loskot.net
_______________________________________________
Gdal-dev mailing list
Gdal-dev at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/gdal-dev




More information about the Gdal-dev mailing list