Ticket #73 (closed defect: fixed)
Perl MapScript - Some methods leak string buffers
| Reported by: | dmorissette | Owned by: | sdlime |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | MapScript | Version: | 3.5 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Some new methods have been added recently that return allocated string buffers and the returned strings are never freed. This problem applies to the following methods: layerObj->getWMSFeatureInfoURL() layerObj->getProjection() mapObj->getProjection() -------- Stephen Lime wrote: > > Heard back from one person, the gist being that unless it could be handled by the > layer destructor (don't think this can) you have to free it by hand. There might be > a way to edit the wrapper code but that involves hand editing which isn't practical. > Let's see if anyone else chimes in. The scripting languages track references so I > don't know why one couldn't link going out of scope (i.e. undef $string) to an > underlying function call (i.e. free). > > Steve > > Stephen Lime > Data & Applications Manager > > Minnesota DNR > 500 Lafayette Road > St. Paul, MN 55155 > 651-297-2937 > > >>> Daniel Morissette <morissette@dmsolutions.ca> 10/31/01 07:21PM >>> > Steve, > > I'm adding a layerObj->getWMSFeatureInfoURL() method in mapscript.i to > be used to fetch a GetFeatureInfo URL from a WMS layer in the mapObj. > > My function returns a newly allocated string that should be freed by the > caller... how should this be handled in mapscript.i to avoid leaking the > string buffer? Is there a way to tell SWIG that the returned string > should be freed by the script when it's done? >
Change History
Note: See
TracTickets for help on using
tickets.
