Fixed potential memory leak in the UI code.
This commit is contained in:
@@ -104,6 +104,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
super( container );
|
super( container );
|
||||||
this.subGui = switchingGuis;
|
this.subGui = switchingGuis;
|
||||||
switchingGuis = false;
|
switchingGuis = false;
|
||||||
|
// TODO : Remove when mezz removes displayGuiScreenWithoutClose() in 1.12.
|
||||||
MinecraftForge.EVENT_BUS.register( this );
|
MinecraftForge.EVENT_BUS.register( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,6 +586,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO : Remove when mezz removes displayGuiScreenWithoutClose() in 1.12.
|
||||||
public void onGuiOpenEvent(GuiOpenEvent event) { // Why oh why mezz? (RecipesGui.java, displayGuiScreenWithoutClose()
|
public void onGuiOpenEvent(GuiOpenEvent event) { // Why oh why mezz? (RecipesGui.java, displayGuiScreenWithoutClose()
|
||||||
if(event.getGui() instanceof IRecipesGui)
|
if(event.getGui() instanceof IRecipesGui)
|
||||||
{
|
{
|
||||||
@@ -597,6 +599,8 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
{
|
{
|
||||||
super.onGuiClosed();
|
super.onGuiClosed();
|
||||||
this.subGui = true; // in case the gui is reopened later ( i'm looking at you NEI )
|
this.subGui = true; // in case the gui is reopened later ( i'm looking at you NEI )
|
||||||
|
// TODO : Remove when mezz removes displayGuiScreenWithoutClose() in 1.12.
|
||||||
|
MinecraftForge.EVENT_BUS.unregister( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Slot getSlot( final int mouseX, final int mouseY )
|
protected Slot getSlot( final int mouseX, final int mouseY )
|
||||||
|
|||||||
@@ -383,6 +383,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
memoryText = this.searchField.getText();
|
memoryText = this.searchField.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO : Remove when mezz removes displayGuiScreenWithoutClose() in 1.12.
|
||||||
@Override
|
@Override
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onGuiOpenEvent(GuiOpenEvent event) {
|
public void onGuiOpenEvent(GuiOpenEvent event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user