Delete blob storage when disposing memory in computer block.

This commit is contained in:
Florian Nücke
2020-10-05 11:40:51 +02:00
parent 1a724c355e
commit 2fd8ee3815
2 changed files with 7 additions and 2 deletions

View File

@@ -149,8 +149,10 @@ public final class BlobStorage {
*
* @param handle the handle to free.
*/
public static void freeHandle(final UUID handle) {
DELETED_HANDLES.add(handle);
public static void freeHandle(@Nullable final UUID handle) {
if (handle != null) {
DELETED_HANDLES.add(handle);
}
}
/**

View File

@@ -217,6 +217,9 @@ public final class ComputerTileEntity extends TileEntity implements ITickableTil
virtualMachine.dispose();
virtualMachine = null;
}
BlobStorage.freeHandle(firmwareBlobHandle);
BlobStorage.freeHandle(ramBlobHandle);
}
private void joinVirtualMachine() {