MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / close

Method close

src/main/java/field/graphics/MeshBuilder.java:215–223  ·  view source on GitHub ↗

closes a MeshBuilder. There should be a close() for every open() and it's an error to let the graphics system get hold of a MeshBuilder that isn't closed properly. Alas, this is a hard error to catch since the missing close() by definition doesn't have a known stacktrace. Closing something that isn'

()

Source from the content-addressed store, hash-verified

213 openCount--;
214 if (openCount == 0) {
215 doClose();
216 }
217 if (openCount < 0) {
218 throw new IllegalArgumentException("more closes than opens?");
219 }
220 }
221
222 private void doClose() {
223 target.setVertexLimit(vertexCursor);
224 target.setElementLimit(elementCursor);
225 }
226

Callers 2

defaultMeshMethod · 0.95
asMap_callMethod · 0.95

Calls 1

doCloseMethod · 0.95

Tested by

no test coverage detected