Author Topic: Error can't remove object  (Read 2609 times)

Offline Disastorm

  • long
  • ***
  • Posts: 161
    • View Profile
Error can't remove object
« 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?
« Last Edit: July 21, 2011, 03:33:48 am by Disastorm »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Error can't remove object
« Reply #1 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?

Offline Disastorm

  • long
  • ***
  • Posts: 161
    • View Profile
Re: Error can't remove object
« Reply #2 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Error can't remove object
« Reply #3 on: July 21, 2011, 11:52:38 am »
Yes, a better log message might do the trick...