Need for msInit() and msFinish()...
Frank Warmerdam
warmerdam at POBOX.COM
Mon Feb 13 08:59:59 EST 2006
Steve Lime wrote:
> Hi all: I'll looking at porting mapgeos.cpp to use the GEOS C API and
> it looks to me like we'll need an msInit() and msFinish() for use in the
> C code and more importantly MapScript. The GEOS C library requires
> initialization and cleanup. We get around it know by maintianing a global
> GeometryFactory and leaking a few bytes. That doesn't look to be possible
> or desireable with the C API.
Steve,
Note, there is already an msCleanup() that scrubs up GDAL/OGR and
a few other things. So the msFinish() should be able to go there.
Can you avoid msInit() by having the geos interface do the initialization
the first time it is entered?
I wonder if we are going to have any conflicts with GDAL/OGR also doing
GEOS init/cleanup stuff.
> Hence the need. We could hide calls in the mapfile load/free code, but there are some cases where MapScript scripts don't need a mapfile so we'd need to expose 'em for those cases.
I don't think we ought to cleanup geos just because a mapfile is
destroyed. And of course sometimes we use many maps in a single
run.
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 mapserver-dev
mailing list