0
0

Hi,

this ist the destructor of my own class SoundManager:
[code:2vgxidl9]SoundManager::~SoundManager()
{
for (int vectorIndex = 0; vectorIndex < (int)soundInstanceVector->capacity(); vectorIndex++)
{
soundInstanceVector->at(vectorIndex)->fileName.clear();
// soundInstanceVector->at(vectorIndex)->streamPtr->close();
delete soundInstanceVector->at(vectorIndex);
}

if (system)
system->release();
}[/code:2vgxidl9]

And amazingly my programm doesn’t close, because I found out, that the function system->release(); blocks. If I comment it out. everything works fine.

Does anyone has an idea what I can do against it? Or is it simply a bug?

  • You must to post comments
0
0

Why aren’t you stopping and releasing the sounds first?

  • You must to post comments
0
0

you will notice every single example calls System::release, when you say ‘blocks’ to you mean hangs, because if it blocks for a few hundred ms then that is expected if it has to close down streams etc.

You have not given a very detailed case or how to reproduce it, i expect maybe you are possibly doing something that makes the system unstable, but i’d need more information.

  • You must to post comments
0
0

ok sorry for less information:
I want to use FMod with Ogre, so I use the SoundManager class(very slightly adjusted), which was written to implement FMod into Ogre.
However anything is wrong with the code, I think, it stops at the release function, how described above.
Not to flood this forum with all my code, you can get the SoundManager class code at:
http://www.h3x0g3n.name/SoundMgr.zip

And this is, what I do in my application:
[code:sa4s6h96]
SoundMgr = new SoundManager;
SoundMgr->Initialize();
SoundMgr->Set3DMinMaxDistance(30,50,0);
SoundMgr->loadSounds();

SoundMgr->playSound(Sound_MainMenu,mNodeCamera);

SoundMgr->FrameStarted(mNodeCamera, 0.1);
SoundMgr->FrameStarted(mNodeCamera, 0.1);

SoundMgr->StopAllSounds();
delete SoundMgr;//stops at system->release();
Beep(200,200);
[/code:sa4s6h96]

And thanks for your quick answers.

  • You must to post comments
0
0

I also had this problem, on the PC with version 4.04.21 – System::release() blocked.

I forgot to release 2 channel groups. Once I put the release() in for the channel groups the problem went away.

Justin

  • You must to post comments
0
0

justinc thanks for your answer. This was exactly my problem!!!
After releasing the 2 channelgroups with
[code:oijdfzwb]
ChannelGroup->release();
[/code:oijdfzwb]
it WORKS!
THANKS

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.