Opened 18 years ago

Closed 15 years ago

#1665 closed defect (fixed)

MapScript needs to run msSetup/msCleanup automagically — at Version 9

Reported by: sdlime Owned by: sdlime
Priority: high Milestone:
Component: MapScript-SWIG Version: 4.8
Severity: normal Keywords:
Cc:

Description (last modified by sdlime)

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

Change History (10)

comment:1 by dmorissette, 18 years ago

Cc: assefa@… dmorissette@… added
I'll add the calls to the PHP MINIT and MSHUTDOWN functions now.

comment:2 by dmorissette, 18 years ago

Added the calls to PHP MINIT and MSHUTDOWN in 4.9-dev

comment:3 by sgillies@…, 18 years ago

Status: newassigned
Did this for Python the other day.

by szekerest, 18 years ago

Attachment: csmodule.i added

csmodule.i

comment:4 by szekerest, 18 years ago

Cc: szekeres.tamas@… added

comment:5 by unicoletti, 18 years ago

Cc: unicoletti@… added
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.

comment:6 by sdlime, 18 years ago

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

Steve

comment:7 by sgillies@…, 18 years ago

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. 

comment:8 by sgillies@…, 18 years ago

Owner: changed from sgillies@… to sdlime
Status: assignednew
reassigning

comment:9 by sdlime, 15 years ago

Description: modified (diff)
Resolution: fixed
Status: newclosed

I believe this is now complete... Closing.

Steve

Note: See TracTickets for help on using tickets.