From f5be596ee8b33fb611dee7b24590e75bb0f4d74f Mon Sep 17 00:00:00 2001 From: historic_bruno Date: Thu, 7 Mar 2013 03:54:41 +0000 Subject: [PATCH] Fixes use of invalid pointer from temporary string (caused some invalid read warnings in Valgrind) This was SVN commit r13237. --- source/graphics/TerrainTextureEntry.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/graphics/TerrainTextureEntry.cpp b/source/graphics/TerrainTextureEntry.cpp index cf101daf2a..18dab5fe49 100644 --- a/source/graphics/TerrainTextureEntry.cpp +++ b/source/graphics/TerrainTextureEntry.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -203,8 +203,8 @@ const float* CTerrainTextureEntry::GetTextureMatrix() // calculate the coordinate of each alphamap within this packed texture void CTerrainTextureEntry::LoadAlphaMaps(VfsPath &amtype) { - const wchar_t* const key = (L"(alpha map composite" + amtype.string() + L")").c_str(); - + std::wstring key = L"(alpha map composite" + amtype.string() + L")"; + CTerrainTextureManager::TerrainAlphaMap::iterator it = g_TexMan.m_TerrainAlphas.find(amtype); if (it != g_TexMan.m_TerrainAlphas.end())