Re: IDLgrPolygon Leak? [message #69995 is a reply to message #69994] |
Wed, 03 March 2010 15:56  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
kBob writes:
>
> Not a memory leak, but a polygon leak.
>
> The 2010 IDL User Group meeting got me inspired to work with some
> object graphics mapping.
>
> However, I am running into some problems with adding a Shapefile to a
> object graphics window. When I call the IDLgrPOLYGON to draw and fill
> the shapefile vertices, there seems to be a leak or overflowing the
> polygon.
>
> Any thoughts on why. Sample code below. The IDLgrPOLYGON is set to
> work with vertices that only have one part. Anything else, the
> IDLgrPOLYLINE is used.
Kelly, you probably already figured this out,
but XObjView doesn't destroy the object that is handed
to it. You have to do that yourself. All this memory
leaking is just due to the model object you created.
For example, you can change your main routine like this.
PRO Test_PolyShp
COMPILE_OPT DEFINT32, STRICTARR
CountryModel, oModelCntry
XOBJVIEW, oModelCntry, /BLOCK
Obj_Destroy, oModelCntry
;WARNING: Big time memory leak
;Do IDL> HEAP_GC, /Verbose
END
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|