www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Disastorm on July 21, 2011, 03:21:08 am

Title: Error can't remove object
Post by: Disastorm on July 21, 2011, 03:21:08 am
Hello, I'm not sure how I got this but I was running my application and I got this can't remove object error:

FATAL EXCEPTION: GLThread 9
RuntimeException ERROR: Can't remove object #218!
at Logger.java:189
at World.removeObject:267
...

*edit I think I may have found what I did wrong, is this the error you get when an object was already removed and you try to remove it again?  I think perhaps my collision listener may have had 2 objects collide at the same time with my object and then what happens is i put my object in a queue to be removed later (during the main thread) so I think maybe it added it twice and tried to remove it twice.  Is this the error I would get in this case?
Title: Re: Error can't remove object
Post by: EgonOlsen on July 21, 2011, 11:01:32 am
Yes, i think it behaves like that...not sure if this is good or not. Any opinions? Should a remove for an already removed (or never added) object cause an error or should it be silently ignored?
Title: Re: Error can't remove object
Post by: Disastorm on July 21, 2011, 11:46:00 am
I guess its up to you, it might be good to have a better log message for anyone who does it accidentally though so at least they know what they did wrong.
Title: Re: Error can't remove object
Post by: EgonOlsen on July 21, 2011, 11:52:38 am
Yes, a better log message might do the trick...