game(client): fix crash on linux/window in touch, fix memory leak in touch
This commit is contained in:
parent
945b11ef12
commit
de3bc51854
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue