[FWTools] pj_init_plus allocation question

Frank Warmerdam warmerdam at pobox.com
Mon Feb 28 16:32:18 EST 2011

On 11-02-28 04:26 PM, Mikhail Tchernychev wrote:
>    Hello List,
> It's just appeared to me that pj_allocation_plus does not allocate new
> memory each time it is called. Depending on the projection parameters,
> it returns already
> allocated structure from the previous call.
> It means that there should not be matching pj_free call for each
> pj_init_plus.
> Is it correct?
> What is if two +proj=latlong projections with different parameters are
> used in the program?
> Would proj_init_plus return the same pointer for both of them?
> Shall I keep track of all pj_free_calls myself (and possibly reference
> count) to clean up?
> Unfortunately I could not search proj mail list - it appeared there is
> no option to search.


The proj list would be a better place for this question.

pj_init_plus() will allocate a new PJ object and there should
be a corresponding pj_free() call for each successful call to

I am not sure what lead you to a different conclusion.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the FWTools mailing list