diff --git a/game/client/touch.cpp b/game/client/touch.cpp index cd6ed2c8..bdaaa1f5 100644 --- a/game/client/touch.cpp +++ b/game/client/touch.cpp @@ -505,8 +505,11 @@ void CTouchControls::CreateAtlasTexture() rectCount++; } - if( !textureList.Count() ) + if( !textureList.Count() || rectCount == 0 ) + { + free(rects); return; + } int atlasHeight = nextPowerOfTwo(sqrt((double)atlasSize)); int sizeInBytes = atlasHeight*atlasHeight*4;