openoli
|
 |
« on: February 27, 2013, 11:35:38 » |
|
Hello again, while debugging the pipeworks demo again and again to understand all the things inside I'm wondering if there's a bug in the PrattlerModuleMediator.as.
My understanding is that after the FeedWindow's close event was fired we should only remove the module mediator of this concrete instance. But the notification handler removes all registered instances?!
/** * Handle PrattlerModule related Notifications. * </P> * Remove the application-level references to the module instance. * Note that the module itself will also be listening for the * window close and will do it's own internal cleanup to ensure * that the instance can be garbage collected.</P> */ override public function handleNotification( note:INotification ):void { switch( note.getName() ) { case ApplicationFacade.REMOVE_FEED_WINDOW: viewComponent = null; var mediatorName:String = this.getMediatorName(); facade.removeMediator(mediatorName); sendNotification(LogMessage.SEND_TO_LOG,"Removed window from shell.",LogMessage.LEVELS[LogMessage.DEBUG]); break; } }
Should do something like this instead of the origin coding, or am I on the wrong track?:
/** * Handle PrattlerModule related Notifications. * </P> * Remove the application-level references to the module instance. * Note that the module itself will also be listening for the * window close and will do it's own internal cleanup to ensure * that the instance can be garbage collected.</P> */ override public function handleNotification( note:INotification ):void { switch( note.getName() ) { case ApplicationFacade.REMOVE_FEED_WINDOW: if(viewComponent.getID() == note.getBody().moduleName as String) { viewComponent = null; var mediatorName:String = this.getMediatorName(); facade.removeMediator(mediatorName); sendNotification(LogMessage.SEND_TO_LOG,"Removed window from shell.",LogMessage.LEVELS[LogMessage.DEBUG]); } break; } }
Thanks for help! Olaf
|