MapServer / MapServer-import

3 stars 2 forks source link

Java MapScript crash while setting the webObj #1798

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: mapserver@geochem.de Date: 2006/06/07 - 06:33

t try to to construct a map from the scratch and build all object by hand.
Sadly mapscript crashes outside the VM when i set the web Object.
When i do the same thing using a map-file everything is fine.
I attached to files (wms_client.map and wms_client_part.java) which
shows my problem using a WMS layer.
tbonfort commented 12 years ago

Author: unicoletti Date: 2006/06/08 - 10:00

The problem is that the webObj has only the default constructor created by swig
which does not call initWeb.
Added web.i with constructor and destructor.
tbonfort commented 12 years ago

Author: szekerest Date: 2006/06/17 - 00:33


I think this is not the only problem. setWeb will copy the webObj structure
itself to the mapObj member but the subsequent objects are not duplicated. Both
mapObj and webObj will own same memory segments and both of them will call free
on it.
As a resolution the entire object tree should be cloned, or the original webObj
should be "disowned".

For more details visit:

http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1803

Tamas