From bb6c33e98aa9fb50fe350da00d62a65cc9002fef Mon Sep 17 00:00:00 2001 From: Fernando-A-Rocha Date: Wed, 18 Dec 2024 09:04:20 +0000 Subject: [PATCH] Fix m_playerMarkerTexture access violation when it was not initialized before attempting to free --- Client/mods/deathmatch/logic/CPlayerMap.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Client/mods/deathmatch/logic/CPlayerMap.cpp b/Client/mods/deathmatch/logic/CPlayerMap.cpp index 0653477e5b..de1529972a 100644 --- a/Client/mods/deathmatch/logic/CPlayerMap.cpp +++ b/Client/mods/deathmatch/logic/CPlayerMap.cpp @@ -57,6 +57,10 @@ CPlayerMap::CPlayerMap(CClientManager* pManager) m_iHorizontalMovement = 0; m_iVerticalMovement = 0; + // Init texture vars + m_mapImageTexture = nullptr; + m_playerMarkerTexture = nullptr; + // Create all map textures CreateAllTextures(); @@ -105,10 +109,8 @@ CPlayerMap::~CPlayerMap() // Delete our images SAFE_RELEASE(m_mapImageTexture); SAFE_RELEASE(m_playerMarkerTexture); - for (uint i = 0; i < m_markerTextureList.size(); i++) SAFE_RELEASE(m_markerTextureList[i]); - m_markerTextureList.clear(); // Don't need to delete the help texts as those are destroyed by the display manager @@ -154,7 +156,6 @@ void CPlayerMap::CreateAllTextures() try { // Create the map texture - m_mapImageTexture = nullptr; m_playerMapImageIndex = g_pCore->GetCVars()->GetValue("mapimage"); CreateOrUpdateMapTexture();