MapServer / MapServer-import

3 stars 2 forks source link

MapScript needs to run msSetup/msCleanup automagically #1665

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: sdlime Date: 2006/02/14 - 19:14

This really applies to multiple components but I had to pick one, so MapScript-
SWIG gets it. This stems from the use of the GEOS C api which requires us to 
call a GEOSinit() and GEOSfinish() when using the library. You definitely want 
to do that only once when MapScript or the CGI are loaded. The MapServer C code 
already defines a couple of functions msSetup/msCleanup to do this. They are 
being used for some OGR cleanup and so on. These would be logical places for 
the GEOS functions. Besides that we need to:

  - add them to PHP's MSINIT and MSHUTDOWN functions
  - add them to language specific interface files for all relevant SWIG 
languages. Python is done (at least for msSetup), so Perl, Ruby, C# and Java 
need to be done.
  - add them to mapserv.c, being mindfull of fast CGI support

Steve
tbonfort commented 12 years ago

Author: dmorissette Date: 2006/02/14 - 20:12

I'll add the calls to the PHP MINIT and MSHUTDOWN functions now.
tbonfort commented 12 years ago

Author: dmorissette Date: 2006/02/14 - 20:33

Added the calls to PHP MINIT and MSHUTDOWN in 4.9-dev
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2006/02/14 - 20:56

Did this for Python the other day.
tbonfort commented 12 years ago

Author: unicoletti Date: 2006/02/16 - 08:41

Java mapscript indeed calls msSetup() on library loading, but msCleanup() not yet.
I'll do some checks to see how the latter can be achieved.
tbonfort commented 12 years ago

Author: sdlime Date: 2006/02/17 - 05:38

Add perl extension interface files following Sean's python lead. msSetup() is
called, but not msCleanup(). Gotta figure out how...

Steve
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2006/02/23 - 16:21

I think calling msCleanup automatically is low priority. I only did it for
Python just for the sake of completeness.

For Java and C#, maybe it would be best to require users to call msSetup()
explicitly at the start of their programs, and then call msCleanup() at the end. 
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2006/06/02 - 04:05

reassigning
tbonfort commented 12 years ago

Author: sdlime Date: 2009/04/04 - 20:25 I believe this is now complete... Closing.

Steve