Skip to content

Commit 1be7135

Browse files
committed
Fixed concurrent vertices access
1 parent 8d3b877 commit 1be7135

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/com/lambda/graphics/pipeline/VertexBuilder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import org.joml.Vector4d
2929
class VertexBuilder(
3030
private val direct: VertexPipeline? = null
3131
) {
32-
val vertices by lazy { mutableListOf<Attribute>() }
33-
val indices by lazy { mutableListOf<Int>() }
32+
val vertices by lazy(LazyThreadSafetyMode.PUBLICATION) { mutableListOf<Attribute>() }
33+
val indices by lazy(LazyThreadSafetyMode.PUBLICATION) { mutableListOf<Int>() }
3434

3535
private var verticesCounter = 0
3636

0 commit comments

Comments
 (0)