[Shapelib] Problems using SHPDestroyObject()

Vassilis Perantzakis vaspervnp at yahoo.gr
Wed Dec 1 01:51:01 PST 2010


padfX and padfY are pointers to double as pointed out, but Brian forgot to
put the * sign after the := sign.

 

They are declared in shapefil.h as:

   double          *padfX;

    double         *padfY;

 

That means you copy the object memory when you assign them to aXIn and aYIn,
not their values. The call to SHPDestroyObject then has a problem with that.


 

The correct syntax should be:

     aXIn := *pSHPStr.padfX; //Array of nVertices X coordinates;

     aYIn := *pSHPStr.padfY; //Array of nVertices Y coordinates; 

 

Tell us  if it helped

 

From: shapelib-bounces at lists.maptools.org
[mailto:shapelib-bounces at lists.maptools.org] On Behalf Of Mario Haertwig
Sent: Friday, November 26, 2010 12:29 PM
To: Shapelib Development
Subject: Re: [Shapelib] Problems using SHPDestroyObject()

 

Hi,
thanks for your help, Brian. I have tried this but there's still the CPU
error message in my IDE when I try to use SHPDestroyObject(). The message
does not appear when I try to access padfX or padfY but when I call
SHPDestroyObject().

Screenshot of the error message:
http://img221.imageshack.us/img221/3159/cpuu.jpg

Mario Haertwig

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/shapelib/attachments/20101201/58c10797/attachment.html>


More information about the Shapelib mailing list