Thanks a lot for your replies, but I still have the same problem, changing it to delete[] did not solve it.
The memory is allocated in this function. I dont have access to the actual LoadTexture function, but I have been told to pass a BYTE pointer to it.
Code:
bool Sprite::loadSprite(std::string fileName)
{
// Load a texture, if not able to load texture, return 0
if(!HAPI->LoadTexture(fileName, &spriteData, &width, &height))
return 0;
// If the whole thing loaded as it should, return 1
return 1;
}
// Private class variable
BYTE *spriteData;
And why not to make it vector?
Make what a vector? The spriteList is the only list I have, and it is already a vector