irrKlang 0.4 error

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
Thomas_
Posts: 34
Joined: Mon May 08, 2006 1:51 am
Location: Corvallis/Eugene, Oregon

irrKlang 0.4 error

Post by Thomas_ »

I create a sound engine with default settings, play a single .mp3 from a file, then ->drop() the sound engine and then i ->drop() the irrlicht device and it is at this point that my application crashes with a standard "blahblah.exe has encountered an error. Should windows report this?" message.

This did not happen before and I cant figure it out, i only added maybe 5-10 lines of code to add irrklang to the app. irrklang plays the sound file fine to its completion and the irrklang engine itself "drops" just fine. Im sure i could let windows deal with the clean up, but i'd rather practice good programming and shutdown correctly. Also, if i try dropping the irrlicht engine and then the irrklang engine, it still crashes on the irrlicht device->drop().

Not sure what this could be, please tell me what you all think...

thanks,

-Thomas
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

This is usually caused by dropping an element which you shouldn't be. The rule is, drop a pointer if you got the pointer from a function with "create" in the function name. If you got the pointer from calling a function with "add" in the function name, the Device/Driver/SMGR/GUI will manage the pointer for you and you don't have to worry about.

If that doesn't help you, can you post your code?
Image
Thomas_
Posts: 34
Joined: Mon May 08, 2006 1:51 am
Location: Corvallis/Eugene, Oregon

Post by Thomas_ »

Yeah, I used smgr->clear() to get rid of the billboards i used, but manually deleted 80 textures "for (...) delete frame;"...

thats probably it, ill try fixing it.

Thanks!
Thomas_
Posts: 34
Joined: Mon May 08, 2006 1:51 am
Location: Corvallis/Eugene, Oregon

Post by Thomas_ »

huh...

That fixed the problem i mentioned above, but i found another place it crashes and it seems to be this line:

dimension2d<f32>(t->getOriginalSize().Width, t->getOriginalSize().Height)

that was the second argument in an addBillboardSceneNode() function call. Im sure i can work around this, but i wonder why that crashed?

(t is a ITexture*)

-tom
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Then t is not a proper pointer, but either 0 or some random value.
Thomas_
Posts: 34
Joined: Mon May 08, 2006 1:51 am
Location: Corvallis/Eugene, Oregon

Post by Thomas_ »

hmm yeah,

but this line is right above that one...

ITexture* t = GetDriver()->getTexture(path.c_str());

...

oh.. ya know, ill bet that path is a bad file path or something..., ill bet i know whats wrong...

Thanks for pointing out the obvious to me, i just spent an hour working on this and its probably just a null pointer :)

-tom
Post Reply