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
irrKlang 0.4 error
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?
If that doesn't help you, can you post your code?
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
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
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
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