No subject


Fri Feb 8 15:06:04 EST 2008


people have had simillar problems and its being put down to a garbage
collection problems in the jvm. The post states you should call the delete
method on a classObj when it is no longer used, I have tried this but its
not got rid of the problem. Can anyone point me in the right direction
please

My code is below...

		layerObj annLayer = mapobject.getLayerByName(sLayerName);
		layerObj newannLayer = new layerObj(mapobject);
	        int featureCounter = 0;
	        while (featureCounter < annLayer.getNumFeatures()){
	            shapeObj shape2 = annLayer.getFeature( featureCounter ,-1); 
	        	if (shape2.getValue(1).equals(sName)){
	        		System.out.println("retreived shape index - " +
shape2.getIndex());
	                        System.out.println("retreived shape - " +
shape2.getValue(1));
	        	}
	        	else{
	        		System.out.println("adding feature to new layer " +
shape2.getValue(1));
	        		newannLayer.addFeature(shape2);
	        	}
	        	featureCounter++;
	        }
	        annLayer.getClass(0).getStyle(0).delete();
	        annLayer.getClass(0).delete();
	        annLayer.delete();
	        mapobject.removeLayer(annLayer.getIndex());
	        newannLayer.setName(sLayerName);
-- 
View this message in context: http://www.nabble.com/mapscript-jvm-crash-on-removeLayer-tf2238325.html#a6206628
Sent from the Mapserver - User forum at Nabble.com.



More information about the mapserver-users mailing list