#1798 closed defect (fixed)
Java MapScript crash while setting the webObj
Reported by: | Owned by: | unicoletti | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | MapScript-Java | Version: | 4.8 |
Severity: | normal | Keywords: | |
Cc: |
Description
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.
Attachments (2)
Change History (4)
by , 18 years ago
Attachment: | wms_client.map added |
---|
by , 18 years ago
Attachment: | wms_client_part.java added |
---|
Java Class wms_client_part.java (shows the crash)
comment:1 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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.
comment:2 by , 18 years ago
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
Note:
See TracTickets
for help on using tickets.
MapFile wms_client.map (works)