a really strange problem
yunwind
yunwind at msn.com
Wed Sep 10 06:22:44 PDT 2008
hello everyone, I meet a very strange problem, the function below give strange result:
2008-09-10 21:13:46,828 Trace game.log - audio sound 822650 259d7c8
2008-09-10 21:13:46,829 Trace game.log - audio 259d7d8 259d7c8
2008-09-10 21:13:46,829 Trace game.log - audio e 259d7c8
2008-09-10 21:13:46,829 Trace game.log - audio e 259d7c8
It seems the stack corrupt, but if I uncomment the declaration of sound1 or remove the line of FMOD_System_CreateStream, then everything is ok:
2008-09-10 21:20:56,745 Trace game.log - audio sound a62650 255d7c8
2008-09-10 21:20:56,746 Trace game.log - audio a62650 255d7c8
2008-09-10 21:20:56,746 Trace game.log - audio a62650 255d7c8
2008-09-10 21:20:56,747 Trace game.log - audio a62650 255d7c8
I am not sure is it a bug, anyone can give some hints? thanks!
Audio createAudio(char[] name, bool stream = false)
{
FMOD_SOUND* sound; //FMOD_SOUND is a typedef of void*
//FMOD_SOUND* sound1;
if (stream) {
FMOD_System_CreateStream(mSystem, toStringz(name), FMOD_SOFTWARE, null, &sound);
logger.trace("audio stream {} {}", mSystem, sound);
}else {
FMOD_System_CreateSound(mSystem, toStringz(name), FMOD_SOFTWARE, null, &sound);
logger.trace("audio sound {} {}", mSystem, sound);
}
logger.trace("audio {} {}", mSystem, sound);
logger.trace("audio {} {}", mSystem, sound);
auto audio = new Audio(null, null);
logger.trace("audio {} {}", mSystem, sound);
return audio;
}
More information about the Digitalmars-d
mailing list