Merge pull request #637 from necropotame/pr-i636-memoryleak

Fixed memory leak after gametype change
This commit is contained in:
Dennis Felsing 2017-03-02 09:47:34 +01:00 committed by GitHub
commit acb1ada28c

View file

@ -109,6 +109,9 @@ int CMapImages::GetEntities()
char path[64];
str_format(path, sizeof(path), "editor/entities_clear/%s.png", file);
if(m_EntitiesTextures >= 0)
Graphics()->UnloadTexture(m_EntitiesTextures);
m_EntitiesTextures = Graphics()->LoadTexture(path, IStorage::TYPE_ALL, CImageInfo::FORMAT_AUTO, 0);
str_copy(m_aEntitiesGameType, Info.m_aGameType, sizeof(m_aEntitiesGameType));