diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java index bb0643b32..f8c520685 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java @@ -105,16 +105,18 @@ public class TerrainQuad extends Node implements Terrain { private TerrainPicker picker; - - protected ExecutorService executor = Executors.newSingleThreadExecutor(new ThreadFactory() { - public Thread newThread(Runnable r) { - Thread th = new Thread(r); - th.setName("jME Terrain Thread"); - th.setDaemon(true); - return th; - } - }); - + protected ExecutorService executor; + + protected ExecutorService createExecutorService() { + return Executors.newSingleThreadExecutor(new ThreadFactory() { + public Thread newThread(Runnable r) { + Thread th = new Thread(r); + th.setName("jME Terrain Thread"); + th.setDaemon(true); + return th; + } + }); + } public TerrainQuad() { super("Terrain"); @@ -229,6 +231,9 @@ public class TerrainQuad extends Node implements Terrain { return; // we just want the root quad to perform this. } + if (executor == null) + executor = createExecutorService(); + UpdateLOD updateLodThread = new UpdateLOD(locations); executor.execute(updateLodThread); }