Little bug in mmStop ?

support for the gba/nds sound library from www.maxmod.org

Moderator: eKid

Post Reply
naroin
Posts: 6
Joined: Mon Jan 19, 2009 1:49 pm

Little bug in mmStop ?

Post by naroin » Thu Jan 22, 2009 8:34 pm

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 ?

eKid
Posts: 65
Joined: Sat Dec 06, 2008 6:07 pm
Contact:

Re: Little bug in mmStop ?

Post by eKid » Fri Jan 23, 2009 4:03 am

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.

naroin
Posts: 6
Joined: Mon Jan 19, 2009 1:49 pm

Re: Little bug in mmStop ?

Post by naroin » Fri Jan 23, 2009 9:52 am

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

eKid
Posts: 65
Joined: Sat Dec 06, 2008 6:07 pm
Contact:

Re: Little bug in mmStop ?

Post by eKid » Tue Jan 27, 2009 12:50 pm

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: )

naroin
Posts: 6
Joined: Mon Jan 19, 2009 1:49 pm

Re: Little bug in mmStop ?

Post by naroin » Tue Jan 27, 2009 1:37 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests