Proposing to set some object members immutable for SWIG mapscript (fix for bug 1803)

Tamas Szekeres szekerest at GMAIL.COM
Sun Jun 18 16:31:28 EDT 2006



According to


The setters of the following object members from the interface may cause
segmentation faults for the mapscript applications (reported mainly for C#
and java).

1. I am proposing to mark these objects as readonly to prevent from having
such problems. I consider having these members writable is not intentional
since the items are created or handled internally from the C code.


classObj.label  (labelObj)

classObj.metadata  (hashTableObj) 

classObj.layer  (layerObj)

fontSetObj.fonts  (hashTableObj)

layerObj.metadata (hashTableObj)

legendObj.label  (labelObj)  (mapObj)

mapObj.symbolset (symbolSetObj)

mapObj.fontset  (fontSetObj)      

mapObj.labelcache  (labelCacheObj)

mapObj.reference  (referenceMapObj)

mapObj.scalebar  (scalebarObj)

mapObj.legend  (legendObj)

mapObj.querymap (queryMapObj)

mapObj.web  (webObj)

mapObj.configoptions  (hashTableObj) (mapObj)

scalebarObj.label (labelObj)

symbolObj.symbol        (symbolObj)    (might be totally hidden  since
getSymbol, getSymbolByName, appendSymbol, removeSymbol can ensure this
functionality)  (mapObj) 

webObj.metadata  (hashTableObj) 



2. I am not totally sure about the following members that may also cause
such problems and should be readonly as well.


labelPathObj.path (lineObj)        

labelPathObj.bounds (shapeObj) 

labelPathObj.angles (double*)

imageObj.format  (outputFormatObj)



3. Not closely related to this problem, but may cause further problems and
should also be marked as readonly (if no objections)


classObj.numstyles  (int)

labelPathObj.bounds (shapeObj)

mapObj.layerorder (int*)

outputFormatObj.numformatoptions  (int)

shapeObj.bounds   - we have setStyle to acheve the same functionality



4. We have also constructor problems related to

objects in the parameter list should be disowned (this is not part of this
proposal but should be done for the various bindings)


new layerObj(map)

new classObj(layer)

new styleObj(parent_class)

new imageObj(int width,int height,outputFormatObj *input_format,char const



Tamas Szekeres



No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.0/368 - Release Date: 2006.06.16.
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the mapserver-dev mailing list