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: Issue with removeCore  (Read 2611 times)
cgm
Newbie
*
Posts: 5


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



View Profile WWW Email
« Reply #1 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>

Logged
cgm
Newbie
*
Posts: 5


View Profile Email
« Reply #2 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.
Logged
Pages: [1]
Print