[Solved] crash after destroyAllSounds

kamaliang

25-06-2009 07:48:58

Hi,
Sometime I want to change scene, and when the old scene have been changed i also need to change the sounds belong to it...so i call

OgreOggSoundManager::destroyAllSounds to clear all the old sounds, but while in the BOOST_THREAD mode, it is crashed in the

OgreOggSoundManager::updateBuffers, cause "mActiveSounds" do not be cleared in the "destroyAllSounds" and result in that "(*i)->_updateAudioBuffers()" is

crashing... :oops:

So.. I add these code after "mSoundMap.clear()" in the destroyAllSounds func like below:

mSoundMap.clear();
mActiveSounds.clear();
mPlayQueue.clear();
mPauseQueue.clear();
mStopQueue.clear();
mPausedSounds.clear();
mSoundsToReactivate.clear();
...

Did i do the right way ? Thanks.... :?:

stickymango

25-06-2009 09:32:34

Hmm, I think that should be okay but I'm going to check it now!

kamaliang

25-06-2009 09:54:36

By the way... the "background.ogg" in the "\TestDemo\media\sounds" folder is very cool...

Each time i tested the application i used it to be tested...aha...

I love many styles of rock & roll... and i think the "background.ogg" is cool enough, the vocal/the keyboard/the guitar/the drum...great...

So, could you tell me which band play the song? Thanks.... 8)

stickymango

25-06-2009 10:44:39

Yeah it is cool, unfortunately I have no idea which band it is, think I got it from an example somewhere, maybe an OgreAL example...

I've committed a fix for the bug you found, thanks for pointing that out! :oops:

Also cleaned up a few other potential caveats regarding my management of internal lists and destruction, so hopefully it shouldn't have anymore destruction related crashes, time will tell... :)

kamaliang

27-06-2009 09:39:34

Yeah...thanks so much...
Aha...but i'm very thirst for the new release of OgreOggSound depending on OGRE1.4.9...
Hehe...^_^...