Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: PureMVC bug?  (Read 3342 times)
sirGordon
Newbie
*
Posts: 4


View Profile Email
« 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.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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>
Logged
sirGordon
Newbie
*
Posts: 4


View Profile Email
« Reply #2 on: December 29, 2011, 02:31:42 »

thanks Cliff :D LOL
Logged
Pages: [1]
Print