fix: resolve concurrent modification exception
@@ -4,12 +4,13 @@ import engine.graphics.Geometry;
import org.apache.commons.lang3.Validate;
import javax.annotation.Nonnull;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public class RenderQueue {
- private final Map<RenderType, GeometryList> queue = new HashMap<>();
+ private final Map<RenderType, GeometryList> queue = Collections.synchronizedMap(new HashMap<>());
public GeometryList getGeometryList(RenderType type) {
return queue.computeIfAbsent(type, key -> new GeometryList());
