FIFE forums

General Category => Help and troubleshooting => Topic started by: conan on November 11, 2015, 07:16:37 pm

Title: Deleting an instance from onInstanceActionFinished()
Post by: conan 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!
Title: Re: Deleting an instance from onInstanceActionFinished()
Post by: Niektory 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().