[SOLVED] Crash in release

shenjoku

12-01-2014 01:18:22

I keep getting a crash in Release when trying to update the OgreOggListener. I've been trying to investigate what the problem is but it's very hard since it's release only so I haven't been able to figure out very much.

My code updating the listener looks like this:
bool tApplication::frameRenderingQueued(const Ogre::FrameEvent & evt)
{
// Other stuff...

// Update the sound listener to follow the position and orientation of the camera. If the camera has a target then use the
// position of the target instead.
OgreOggSound::OgreOggListener * soundListener(fOggSoundManager->getListener());

if (soundListener != nullptr)
{
Ogre::SceneNode * parentSceneNode(fCamera->getParentSceneNode());

// Crashes here.
soundListener->setPosition(parentSceneNode != nullptr ? parentSceneNode->_getDerivedPosition() : fCamera->getPosition());
soundListener->setOrientation(fCamera->getOrientation());
}

fOggSoundManager->update(evt.timeSinceLastEvent);

// Other stuff...
}


When calling setPosition() it will crash on the call to alListener3f(), and by turning on debug info in Release it looks like the listener object has either been deleted or heavily corrupted since all of its members contain garbage. If I remove the calls setting anything on the listener then it runs fine. This crash also only occurs if OGGSOUND_THREADED is turned on.

Mostly just looking for input on what anyone thinks might be the issue of if anyone else can reproduce it since I'm completely stuck.

shenjoku

14-01-2014 21:22:11

Found the problem. I forgot to add the OGGSOUND_THREADED macro to the preprocessor definitions of our main project, which was causing the OgreOggSoundManager class to be compiled differently making some member variable addresses not match up. Fun times...