ok, i solved some of the probems with quitting ogre and exceptions attaching mutexes on Root::RenderOneFrame() and ogre variables , that seemed to be a problem, still i got two other problems :
1 while running these lines
Code: Select all
im.load(b,ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
TextureManager::getSingleton().unload("TestTexture");
TextureManager::getSingleton().remove("TestTexture");
TexturePtr mTexture = TextureManager::getSingleton().loadImage( "TestTexture",ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, im, TEX_TYPE_2D, -1, 1.0f );
4-5 times my textures chnage from
everything is ok , no crashes but the materials on walls seem to be broken ( those are demo Examples/Bumpmapping.....)
and second problem :
ogreleaks.log
always has some leaks , and i managed to trace that following code generates them :
Code: Select all
ConfigFile::SectionIterator seci = cf.getSectionIterator();
Ogre::String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
MaterialManager::getSingleton().initialise();
MaterialManager::getSingleton().setDefaultAnisotropy(2);
MaterialManager::getSingleton().create( "haha",ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME );
MaterialManager::getSingleton().create( "FileMaterial" ,ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
//this->createTexture(Color::HotPink);
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
and sample lines from ogreleaks.log :
52 memory leaks found:
Alloc. Addr Size Addr Size BreakOn BreakOn
Number Reported Reported Actual Actual Unused Method Dealloc Realloc Allocated by
------ ---------- ---------- ---------- ---------- ---------- -------- ------- ------- ---------------------------------------------------
008318 0x110EBB18 0x000001B4 0x110EBB08 0x000001D4 0x00000000 new N N ??(0) ??
008317 0x110EBEB0 0x00000020 0x110EBEA0 0x00000040 0x00000000 new N N ??(0) ??
008319 0x110EBF30 0x00000024 0x110EBF20 0x00000044 0x00000000 new N N ??(0) ??
008320 0x110EBFB0 0x00000044 0x110EBFA0 0x00000064 0x00000000 new N N ??(0) ??
008321 0x110F2498 0x00000044 0x110F2488 0x00000064 0x00000000 new N N ??(0) ??
008322 0x110F2538 0x00000044 0x110F2528 0x00000064 0x00000000 new N N ??(0) ??
008323 0x110F25D8 0x00000044 0x110F25C8 0x00000064 0x00000000 new N N ??(0) ??