Skip to content

Commit

Permalink
Fix memory leak in stack size rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Feb 11, 2025
1 parent 9d383c7 commit cfcd10b
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@
package appeng.client.gui.me.common;

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.ByteBufferBuilder;

import org.joml.Matrix4f;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.MultiBufferSource.BufferSource;

import appeng.core.AEConfig;

Expand All @@ -47,7 +45,7 @@ private static void renderSizeLabel(Matrix4f matrix, Font fontRenderer, float xP
final int X = (int) ((xPos + offset + 16.0f + 2.0f - fontRenderer.width(text) * scaleFactor)
* inverseScaleFactor);
final int Y = (int) ((yPos + offset + 16.0f - 5.0f * scaleFactor) * inverseScaleFactor);
BufferSource buffer = MultiBufferSource.immediate(new ByteBufferBuilder(512));
var buffer = Minecraft.getInstance().renderBuffers().bufferSource();
fontRenderer.drawInBatch(text, X + 1, Y + 1, 0x413f54, false, matrix, buffer, Font.DisplayMode.NORMAL, 0,
15728880);
fontRenderer.drawInBatch(text, X, Y, 0xffffff, false, matrix, buffer, Font.DisplayMode.NORMAL, 0, 15728880);
Expand Down

0 comments on commit cfcd10b

Please sign in to comment.