sorry for my bad english.
I have a problem with the memory-management with irrlicht. I want to load parts of my map dynamic. This works already well, but when I'm go away from the specific map-part the part should be free from memory.
The program loads the textures and meshs in another thread to the RAM, after that, the main-thread creates a virtual IReadFile via createMemoryReadFile and creates an image of the raw-data:
Code: Select all
[...]
IReadFile* file = currentEngine->filesystem->createMemoryReadFile( this->jobTexture[i]->buffer,
this->jobTexture[i]->bufferSize,
(LPCTSTR)name,
false);
if(file)
{
IImage* img = currentEngine->driver->createImageFromFile(file);
if(!img)
{
[...]
}
[...]
img->drop();
file->drop();
}
[...]
free(this->jobTexture[i]->buffer);
Code: Select all
[...]
if(!this->splattingTexture)
{
[...]
this->splattingTexture = currentEngine->driver->addTexture((LPCTSTR)name, this->splattingImage);
}
[...]
Code: Select all
[...]
if(this->meshNode)
{
this->meshNode->remove();
this->meshNode = NULL;
}
if(this->mesh)
{
currentEngine->smgr->getMeshCache()->removeMesh(this->mesh);
this->mesh = NULL;
}
if(this->splattingTexture)
{
currentEngine->driver->removeTexture(this->splattingTexture);
//this->splattingTexture->drop(); // i tried this before, same effect
this->splattingTexture = NULL;
}
[...]
if(this->splattingImage)
{
this->splattingImage->drop();
this->splattingImage = NULL;
}
[...]
("Access violation reading location 0x43700000")0xC0000005: Zugriffsverletzung beim Lesen an Position 0x43700000.
What can I do?
Thank you!
Greetings,
Bastian