Fix for unlucky memory leak
This commit is contained in:
@@ -145,6 +145,9 @@ public class GeometryManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void free() {
|
public void free() {
|
||||||
|
while (!this.buildResults.isEmpty()) {
|
||||||
|
this.buildResults.pop().free();
|
||||||
|
}
|
||||||
this.sectionMetaBuffer.free();
|
this.sectionMetaBuffer.free();
|
||||||
this.geometryBuffer.free();
|
this.geometryBuffer.free();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ public class RenderGenerationService {
|
|||||||
int buildFlags = task.flagSupplier.applyAsInt(section);
|
int buildFlags = task.flagSupplier.applyAsInt(section);
|
||||||
if (buildFlags != 0) {
|
if (buildFlags != 0) {
|
||||||
var mesh = factory.generateMesh(section, buildFlags);
|
var mesh = factory.generateMesh(section, buildFlags);
|
||||||
|
section.release();
|
||||||
|
|
||||||
this.resultConsumer.accept(mesh.clone());
|
this.resultConsumer.accept(mesh.clone());
|
||||||
|
|
||||||
if (false) {
|
if (false) {
|
||||||
@@ -67,8 +69,9 @@ public class RenderGenerationService {
|
|||||||
} else {
|
} else {
|
||||||
mesh.free();
|
mesh.free();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
section.release();
|
||||||
}
|
}
|
||||||
section.release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user