From b87d044cf08e889082740a93c7bd549585b52013 Mon Sep 17 00:00:00 2001 From: piebot Date: Sat, 1 Aug 2026 22:56:12 +0300 Subject: [PATCH] fix crash when opening loadorjoin a second time --- Minecraft.Client/Common/Network/SessionInfo.h | 2 +- Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Minecraft.Client/Common/Network/SessionInfo.h b/Minecraft.Client/Common/Network/SessionInfo.h index 9d32245c..982234dc 100644 --- a/Minecraft.Client/Common/Network/SessionInfo.h +++ b/Minecraft.Client/Common/Network/SessionInfo.h @@ -131,6 +131,6 @@ public: ~FriendSessionInfo() { if(displayLabel!=NULL) - delete displayLabel; + delete[] displayLabel; } }; diff --git a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp index 5b45e20b..fd46e96c 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -290,13 +290,7 @@ UIScene_LoadOrJoinMenu::~UIScene_LoadOrJoinMenu() g_NetworkManager.SetSessionsUpdatedCallback( NULL, NULL ); app.SetLiveLinkRequired( false ); - if(m_currentSessions) - { - for(AUTO_VAR(it, m_currentSessions->begin()); it < m_currentSessions->end(); ++it) - { - delete (*it); - } - } + delete m_currentSessions; #if TO_BE_IMPLEMENTED // Reset the background downloading, in case we changed it by attempting to download a texture pack