Fixed gridX,gridY memory leak