1

I'm creating an object that is Event.class and this event run like a game event for X minutes. The Player participates and it runs and then it finishes. I store this Object in a EventManager.java and when it's done I release it from EventManager.java

I guess GC is coming to finish this Object after a while since it's not used. What about the lists that this Event.class is using. The places that are still in there I must clean those lists (will this block the action of the garbage collector) or it will go away anyway since it's not saved - assigned anywhere?

Hakan Dilek
  • 2,178
  • 2
  • 23
  • 35

1 Answers1

1

No, you shouldn't worry about them. once the Event.class is released the list will be unreferenced and will be allegeable for the GC to be collected. Unless, as mentioned, you have are holding a ref to those list somewhere else.

Roee Gavirel
  • 18,955
  • 12
  • 67
  • 94