EventMap in Actor and lost event handlers

pavel.fljot's Avatar

pavel.fljot

12 Nov, 2013 12:41 PM

Hello. Please give me a hint what could be wrong. My controller (yes, for some tasks I'm going with stateful controllers rather than commands) extends Actor, it's mapped as Singleton, and in [PostConstruct] I listen to context event there this way:

eventMap.mapListener(eventDispatcher, BoosterEvent.USE_INGAME, onUseIngameBooster, BoosterEvent);

which is not triggered. But if I use non-week reference option — it works. How come that something get's GCed?

For me it looks like mediators' addContextListener is implemented in the exact same fashion, but it works well with week-referenced listeners.

  1. Support Staff 1 Posted by creynders on 12 Nov, 2013 12:50 PM

    creynders's Avatar

    How is the instantiation of the controller enforced?

  2. 2 Posted by pavel.fljot on 12 Nov, 2013 01:09 PM

    pavel.fljot's Avatar

    In context

    ...
    super.startup();
    injector.instantiate(BoostersController);
    }
    
  3. 3 Posted by pavel.fljot on 12 Nov, 2013 01:11 PM

    pavel.fljot's Avatar
  4. pavel.fljot closed this discussion on 12 Nov, 2013 01:51 PM.

  5. creynders re-opened this discussion on 12 Nov, 2013 02:34 PM

  6. Support Staff 4 Posted by creynders on 12 Nov, 2013 02:34 PM

    creynders's Avatar

    Glad my question helped ;)

  7. Support Staff 5 Posted by creynders on 12 Nov, 2013 02:34 PM

    creynders's Avatar

    Oops, didn't mean to re-open.

  8. creynders closed this discussion on 12 Nov, 2013 02:34 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac