mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-11 15:57:31 +00:00
Remove static keyword from render block variables
The static keyword was removed from several instances of RenderBlocksCTM and RenderBlocksCTMFullbright variables in various SubmapManager classes and ChiselController class. This was done to fix a potential memory leak issue where these static objects could persist in memory even when they're no longer needed. Also, related to this change, the onWorldUnload method that used to clear static reference of RenderBlocksCTMFullbright has been removed from ChiselController.
This commit is contained in:
1 parent
f4291635b2
commit
ea103bcc80
5 files changed
+4
-15
No files matched your search
@@ -75,7 +75,7 @@ public class SubmapManagerAntiblock extends SubmapManagerBase {
|
||||
};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static RenderBlocksCTMFullbright rb;
|
||||
private RenderBlocksCTMFullbright rb;
|
||||
|
||||
private String color;
|
||||
private TextureSubmap submap, submapSmall;
|
||||
|
||||
@@ -14,7 +14,7 @@ import team.chisel.ctmlib.TextureSubmap;
|
||||
public class SubmapManagerCarpetFloor extends SubmapManagerBase {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static RenderBlocksCTM rb;
|
||||
private RenderBlocksCTM rb;
|
||||
|
||||
private TextureSubmap submap;
|
||||
private TextureSubmap submapSmall;
|
||||
|
||||
@@ -16,7 +16,7 @@ import team.chisel.ctmlib.TextureSubmap;
|
||||
public class SubmapManagerSlab implements ISubmapManager {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static RenderBlocksCTM rb;
|
||||
private RenderBlocksCTM rb;
|
||||
|
||||
private TextureSubmap submap;
|
||||
private TextureSubmap submapSmall;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class SubmapManagerSpecialMaterial extends SubmapManagerBase {
|
||||
}
|
||||
};
|
||||
|
||||
private static RenderBlocksCTMFullbright renderBlocksFullbright;
|
||||
private RenderBlocksCTMFullbright renderBlocksFullbright;
|
||||
|
||||
private String color;
|
||||
private MaterialType materialType;
|
||||
@@ -85,8 +85,4 @@ public class SubmapManagerSpecialMaterial extends SubmapManagerBase {
|
||||
return renderBlocksFullbright;
|
||||
}
|
||||
|
||||
public static void clearRenderBlocksInstance() {
|
||||
renderBlocksFullbright = null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -163,11 +163,4 @@ public final class ChiselController {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
if (event.world.isRemote) {
|
||||
SubmapManagerSpecialMaterial.clearRenderBlocksInstance();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user