PureMVC Architects Lounge

PureMVC Manifold => MultiCore Version => Topic started by: cgm on March 22, 2010, 07:27:31



Title: Issue with removeCore
Post by: cgm on March 22, 2010, 07:27:31
Hello ,

I am having a problem with removing a core completely , to do so i am using Facade.removeCore(key) ;
then i check Facade.hasCore(key) and it says false . all good till now .

When i recreate the same core at a later point and try instantiating it with the same key .
the instanceMap[key] seems to still contain a Facade object and thus my problem .
I checked the Facade.as and the removeCore should delete the instanceMap[key] so now i can reuse same key but something seems to be wrong ...

Any Help would be great.

Thx.


Title: Re: Issue with removeCore
Post by: puremvc on March 22, 2010, 11:16:50
Flex event listeners on view and service components can make it difficult to fully unhook things. You may need to send your core a 'destroy' message that fires off a command that removes the proxies and mediators. In the onRemove method of the proxies and mediators be sure to remove any service or view listeners, cancel and null service objects, etc.

Also there's a good article on garbage collection with multicore by Simon Bailey that you might want to give a read: http://www.newtriks.com/?p=132

-=Cliff>



Title: Re: Issue with removeCore
Post by: cgm on March 22, 2010, 05:45:47
Thx Cliff  :) . I think i know what to fix now.
Definitely thats the issue which i was trying to avoid since that core itself got few child core directly linked to it so now i need to send a destroy message to all the child cores as well i suppose .
I need to do it anyways for gc to work properly and i to regain the memory.