FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: Deleting an instance from onInstanceActionFinished()  (Read 796 times)

conan

  • Newbie
  • Posts: 17
    • View Profile
Deleting an instance from onInstanceActionFinished()
« on: November 11, 2015, 07:16:37 pm »

Hi,

Is there a way to delete an instance from within onInstanceActionFinished() or anywhere that is called from it? The engine crashes if I try to do this because after the call it checks for "instance" (the parameter that was passed) and can't find it anymore.

Right now I'm putting the instance in a vector and I check the vector every pump() and free it. I don't think this is a very elegant way. Is there any other way?

Thanks!
Logged

Niektory

  • Newbie
  • Posts: 29
    • View Profile
Re: Deleting an instance from onInstanceActionFinished()
« Reply #1 on: November 11, 2015, 08:27:26 pm »

I don't think there's another way. You should be careful in general with calling engine functions in onInstanceActionFinished(), safer to do it in pump().
Logged