I create the image set as follows.
Code: Select all
Ogre::Image image;
image.load
(
params->imageFile,
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
);
OgreTexture = Ogre::TextureManager::getSingleton().loadImage
(
imageName,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
image
);
OgreCEGUIRenderer* mRenderer = (OgreCEGUIRenderer*) CEGUI::System::getSingleton().getRenderer();
CeguiTexture = mRenderer->createTexture(OgreTexture);
CeguiImageSet = CEGUI::ImagesetManager::getSingleton().createImageset
(
imageSetName,
CeguiTexture
);
CeguiImageSet->defineImage(ImageSetImageName, CEGUI::Point(0.0f, 0.0f),
CEGUI::Size(CeguiTexture->getWidth(), CeguiTexture->getHeight()),
CEGUI::Point(0.0f,0.0f));
Then later I delete the imageset as follows
Code: Select all
CeguiImageSet->undefineImage(ImageSetImageName);
CEGUI::ImagesetManager::getSingleton().destroyImageset(CeguiImageSet);
The code does not crash in the destroyImageset() call. But soon after the application crashes in OgreRoot->startRendering(). I am not sure where exactly it crashes within startRendering() because I dont have ogre source code in my setup.
If I uncomment the destroyImageset() then things work fine, but I am afraid I would be leaking memory.
I have followed through old emails on this topic, but mine seems to be a different issue than what others experienced. There was a post in 2004 that seemed related, but it seemed too old to be relevant any more.