Need for msInit() and msFinish()...

Steve Lime steve.lime at DNR.STATE.MN.US
Mon Feb 13 11:58:16 EST 2006


Does MapScript use it when the module is loaded? Is msCleanup
called when the module is unloaded? That would be ideal since
no changes to existing scripts would be necessar.

Steve

>>> Sean Gillies <sgillies at FRII.COM> 02/13/06 8:31 AM >>>
On Feb 13, 2006, at 6:59 AM, Frank Warmerdam wrote:

> 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.
>

I'm reminded that we also already have a msSetup() function that is  
used by mapscript.

Sean



More information about the mapserver-dev mailing list