Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualKhatharr

Posted 26 April 2013 - 06:04 AM

You're dropping the object too many times or else there's a bug in your version of irrlicht which is causing the object to be released too many times.

 

I know irrklang has a ridiculous and invasive memory management model. It looks like that extends into the realm of irrlicht in general, since the code you posted is one of the guilty parties. When I used irrklang there were constant bugs surrounding the poorly designed memory management and when I asked the author why he was doing things so bass-ackwards he blew me off, so I ended up just switching to FMOD, which is fantastic and far easier to work with.

 

Basically when you create the object it has one reference. When you do certain things to it that number increases, and when you call its drop() method the number decreases. The refcounter keeps track of how many things are referring to an object and deletes the object when that number reaches zero. If you try to drop or otherwise dispose of the object after that you'll get that segfault you're getting. Read the documentation carefully to see what all changes the refcount on the stuff you're using. When you shut down irrlicht it drops a lot of stuff, so it can segfault if some of that is already released.

 

Or just switch to FMOD. If your sound handling is properly abstracted it should only take a small amount of effort to make the switch.


#1Khatharr

Posted 26 April 2013 - 06:03 AM

You're dropping the object too many times or else there's a bug in your version of irrlicht which is causing the object to be released too many times.

 

I know irrklang has a ridiculous and invasive memory management model. It looks like that extends into the realm of irrlicht in general, since the code you posted is one of the guilty parties. When I used irrklang there were constant bugs surrounding the poorly designed memory management and when I asked the author why he was doing things so bass-ackwards he blew me off, so I ended up just switching to FMOD, which is fantastic and far easier to work with.

 

Basically when you create the object it has one reference. When you do certain things to it that number increases, and when you call its drop() method the number decreases. The refcounter keeps track of how many things are referring to an object and deletes the object when that number reaches zero. If you try to drop or otherwise dispose of the object after that you'll get that segfault you're getting. Read the documentation carefully to see what all changes the refcount on the stuff you're using.

 

Or just switch to FMOD. If your sound handling is properly abstracted it should only take a small amount of effort to make the switch.


PARTNERS