Page 1 of 1

Little bug in mmStop ?

Posted: Thu Jan 22, 2009 8:34 pm
by naroin
Hi,

I've just discovered that if you do a mmStop while no music is playing, the sound system crashes.
I easily found a workaround

Code: Select all

if (mmActive())
   mmStop();
but maybe there should be a protection in mmStop ?

Re: Little bug in mmStop ?

Posted: Fri Jan 23, 2009 4:03 am
by eKid
Hmm, that is strange. Using mmStop when there's no music playing shouldn't crash the system. :/

Are you sure there's nothing else that could be causing the problem? Using multiple mmStops works fine in the examples.

Re: Little bug in mmStop ?

Posted: Fri Jan 23, 2009 9:52 am
by naroin
To be sure, before posting to this forum, I've modified the basicsound sample:

pressing A calls mmStop and mmUnload
pressing B calls mmLoad and mmPlay

A+B+A+B+A+B... works fine

A+A+B : nothing plays

I can send you the code if necessary

Re: Little bug in mmStop ?

Posted: Tue Jan 27, 2009 12:50 pm
by eKid
Heh, calling mmUnload when nothing is loaded will probably crash something... (oops i forgot to check for that). You really want to load something only once, then unload it when you are finished with it. If you load something more than once, the first load will actually load the data, and the extra loads will just increase the reference count, so then you'll need multiple unloads to get it out of memory. (or does this only apply with sound effects :roll: )

Re: Little bug in mmStop ?

Posted: Tue Jan 27, 2009 1:37 pm
by naroin
well, to be sure, i just made a mmStop (without mmUnload), and it crashes the same way :)

now i just do a "if mmActive" before the stop, and i have no problem, so that's not really anoying.