diff --git a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/ApplicationGIS.java b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/ApplicationGIS.java index 2558c4fa62..64293c7c07 100644 --- a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/ApplicationGIS.java +++ b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/ApplicationGIS.java @@ -802,7 +802,9 @@ public void run(IProgressMonitor monitor) RendererCreator decisive = new RendererCreatorImpl(); decisive.setContext(tools); - decisive.getLayers().addAll(layersToRender); + synchronized (decisive.getLayers()) { + decisive.getLayers().addAll(layersToRender); + } SortedSet sortedContexts = new TreeSet( decisive.getConfiguration()); diff --git a/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/internal/render/impl/RendererCreatorImpl.java b/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/internal/render/impl/RendererCreatorImpl.java index cc93e2edd1..3ceff13b39 100644 --- a/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/internal/render/impl/RendererCreatorImpl.java +++ b/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/internal/render/impl/RendererCreatorImpl.java @@ -499,12 +499,14 @@ public SelectionLayer findSelectionLayer( ILayer targetLayer ) { } catch (IOException e) { return null; } - for( Layer layer : getLayers() ) - if (layer instanceof SelectionLayer) - if (((SelectionLayer) layer).getWrappedLayer() == targetLayer) - return (SelectionLayer) layer; + synchronized (getLayers()) { + for (Layer layer : getLayers()) + if (layer instanceof SelectionLayer) + if (((SelectionLayer) layer).getWrappedLayer() == targetLayer) + return (SelectionLayer) layer; - return null; + return null; + } } /**