Skip to content
Snippets Groups Projects
Commit f2c2a021 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

BUG: no premature pessimization... only one allocation

parent 000995a7
Branches
Tags
No related merge requests found
......@@ -458,9 +458,10 @@ void TileMapImageIO::GenerateBuffer(unsigned char *p)
int firstSample = this->GetIORegion().GetIndex()[0];
int nComponents = this->GetNumberOfComponents();
unsigned char * bufferTile = new unsigned char[256 * 256 * nComponents];
for (unsigned int currentTile = 0; currentTile < m_ListTiles.size(); currentTile++)
{
unsigned char * bufferTile = new unsigned char[256 * 256 * nComponents];
// Read tile from cache
this->ReadTile(m_ListTiles[currentTile].filename, bufferTile);
......@@ -495,8 +496,8 @@ void TileMapImageIO::GenerateBuffer(unsigned char *p)
}
}
} //end of tile copy
delete[] bufferTile;
} //end of full image copy
delete[] bufferTile;
}
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment