2007/6/1, Arkadi Shishlov <[EMAIL PROTECTED]>:

I'm also interested what is the semantic of shapeObj.add() and 
layerObj.addFeature()?
     shapeObj o = new shapeObj(MS_SHAPE_TYPE.MS_SHAPE_POINT.swigValue());
     lineObj n = new lineObj();
     n.add(rulerXY1);
     o.add(n);
     layer.addFeature(o);
Then both shape and line goes out of scope. Is it prone to crash?


Both shapeObj.add() lineObj.add() and layerObj.addFeature() create a
clone of the objects before adding them to the list. Therefore there's
no need to transfer the ownership of the underlying C memory. You can
safely use these methods considering that you cannot alter the
properties of the added objects using the original reference. You
should get back the reference of the objects similarly as you have
done in the previous cases.

Best regards,

Tamas

Reply via email to