Fix cleaning, add assertion

This commit is contained in:
mcrcortex
2025-05-20 10:09:37 +10:00
parent 055be2aa2a
commit 5c8f2a43cb
3 changed files with 11 additions and 3 deletions

View File

@@ -337,6 +337,9 @@ public class RenderGenerationService {
}
this.taskMapLock.unlockWrite(stamp);
}
if (this.taskQueueCount.get() != 0) {
throw new IllegalStateException();
}
}
private long lastChangedTime = 0;

View File

@@ -667,7 +667,6 @@ public class AsyncNodeManager {
throw new RuntimeException(e);
}
//TODO CLEAN
while (true) {
var buffer = this.requestBatchQueue.poll();
if (buffer == null) break;
@@ -675,7 +674,7 @@ public class AsyncNodeManager {
}
while (true) {
var buffer = this.requestBatchQueue.poll();
var buffer = this.removeBatchQueue.poll();
if (buffer == null) break;
buffer.free();
}
@@ -686,6 +685,12 @@ public class AsyncNodeManager {
buffer.free();
}
while (true) {
var section = this.childUpdateQueue.poll();
if (section == null) break;
section.release();
}
if (RESULT_HANDLE.get(this) != null) {
var result = (SyncResults)RESULT_HANDLE.getAndSet(this, null);
result.geometryUpload.free();

View File

@@ -127,7 +127,7 @@ public class VoxyInstance {
this.importManager.cancelImport(world);
if (world.getActiveSectionCount() != 0) {
Logger.warn("Waiting for world to finish use");
Logger.warn("Waiting for world to finish use: " + world );
while (world.getActiveSectionCount() != 0) {
try {
Thread.sleep(100);