PureMVC Architects Lounge

PureMVC Manifold => MultiCore Version => Topic started by: sirGordon on December 27, 2011, 06:04:24



Title: PureMVC bug?
Post by: sirGordon on December 27, 2011, 06:04:24
Hello community, i have a strange situation that for me looks like a bug. Here are steps to reproduce:

User interacts with a window behind which i have the following microarchitecture:
myFacade that extends basic Facade
myProxy that extends Proxy behind myFacade.
myproxy has method getData that requests data from server asynchronously (AMF) using AsyncToken and Responder and then passes data to view via sendNotification method.

Now what do i do:
1. I create window, instantiate myFacade and myProxy, and call getData method.
2. Before server responds, user closes the window, so Facade.removeCore is called, and myFacade is removed.
3. Now server responds, and onResult method in myProxy calls sendNotification, which instantiates Facade with my multiton key (it is cached in Notifier) and i get a new Facade instance in the instanceMap of wrong type. LOL

Any ideas? Thanks in advance.


Title: Re: PureMVC bug?
Post by: puremvc on December 27, 2011, 08:29:37
Before removing the core you should do any cleanup inside the core that you know may cause problems. When the user closes the window, before removing the core, you should retrieve the Proxy and make a call to cancel the service call.

-=Cliff>


Title: Re: PureMVC bug?
Post by: sirGordon on December 29, 2011, 02:31:42
thanks Cliff :D LOL