Solved Do registered listeners remain active after the object they were registered in was destroyed?

Discussion in 'Plugin Development' started by amitlin14, Aug 11, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    amitlin14

    I have a game session class, that has inside it several listeners. When the class is created it registers the listeners.

    My question is, when i destroy the object(GameSession = null;), do the listeners inside of it remain active?
     
  2. Offline

    blablubbabc

    I would guess "yes". You are just clearing one reference to the object (you don't "destroy" it). When you registered your object as listener, the plugin manager (or whereever craftbukkit stores the listeners) still holds another reference to the object.

    Edit: if you are interested: your listener object is stored here after you have registered your event(s).
     
  3. Offline

    amitlin14

  4. Offline

    blablubbabc

  5. Offline

    amitlin14

Thread Status:
Not open for further replies.

Share This Page