Indirect crash (memory corruption?) with destroyImageset()

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

velur_senthil
Just popping in
Just popping in
Posts: 3
Joined: Wed Aug 13, 2008 04:30
Contact:

Indirect crash (memory corruption?) with destroyImageset()

Postby velur_senthil » Wed Oct 01, 2008 19:16

I am having a problem with destroyImageset().

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.

velur_senthil
Just popping in
Just popping in
Posts: 3
Joined: Wed Aug 13, 2008 04:30
Contact:

Re: Indirect crash (memory corruption?) with destroyImageset

Postby velur_senthil » Wed Oct 01, 2008 23:05

I think i figured out why this was happening. It was my bad!!

I was using the imageset for a staticimage window. I was destroying the imageset, but the staticimage Window is still attached to its parent. I think this was causing the problem.

Now i remove the staticimage window from its parent before destroying the imageset. This seems to have stopped the crash.

Thanks
Senthil


Return to “Help”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 12 guests