[Gdal-dev] missing function to destroy properly OGRStyleTool ?

Fabien Dachicourt support at geoimage.fr
Mon Nov 28 11:05:16 EST 2005


Hi,
i'm using styles with OGR to display geometries.

for a given feature, i get OGRStyleTool objects from style manager with "GetPart", then i delete them on my own.
My problem is i'm wondering if i can delete on my own these OGRStyleTool while they are created inside a gdal/ogr function (GetPart).

I know that many problems appear when the "new" is done inside gdal/ogr library, whereas the "delete" is done outside (the best example is OGRGeometry for which we have to use OGRGeometryFactory to create and destroy geometries).

My question is : how can i delete properly these OGRStyleTools ?


This is my source code :

poStyleMgr->GetStyleString(poFeature);

   for (int i = 0; i < poStyleMgr->GetPartCount(); i++)
   {
       OGRStyleTool* poStyleTool = poStyleMgr->GetPart(i);

       if (poStyleTool)
       {
            switch(poStyleTool->GetType())
            //process....

            delete poStyleTool;
        }
    }

Thanks in advance,
Fabien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20051128/0a959267/attachment.html


More information about the Gdal-dev mailing list