<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>Hi,</DIV>
<DIV>i'm using styles with OGR to display geometries.</DIV>
<DIV> </DIV>
<DIV>for a given feature, i get OGRStyleTool objects from style manager with
"GetPart", then i delete them on my own.</DIV>
<DIV>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).</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>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).</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>My question is : how can i delete properly these OGRStyleTools ?</DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This is my source code :</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>poStyleMgr->GetStyleString(poFeature);</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> for (int i = 0; i < poStyleMgr->GetPartCount();
i++)<BR> {<BR> OGRStyleTool*
poStyleTool = poStyleMgr->GetPart(i);</DIV>
<DIV> </DIV>
<DIV> if
(poStyleTool)<BR> {<BR>
switch(poStyleTool->GetType())<BR>
//process....</DIV>
<DIV> </DIV>
<DIV>
<DIV> delete
poStyleTool;</DIV></DIV>
<DIV> }</DIV>
<DIV> }</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=Arial size=2>Fabien</FONT></DIV></BODY></HTML>