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 [2]
Print
Author Topic: Pipes Utility - Disconnecting Pipes  (Read 23627 times)
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #15 on: August 07, 2008, 05:20:29 »

Yes, assuming the pipe to the shell was working before the mediator was removed, it should still work afterwards. The junction still exists, you've merely removed the mediator from the View in the module, so it can no longer be notified.

-=Cliff>
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #16 on: August 07, 2008, 05:52:28 »

Also, you don't have to break the pipeline apart and dispose of each fitting separately for them to be GC'd.

Due to the way Flash does garbage collection (reference counting + mark & sweep), you can simply remove the pipes leading to or from the module in question, do a removeCore on the module's facade, then unload the module. QED.

In the simplest of bidirectional cases, the ShellJunctionMediator has an output pipe leading to the module and an input pipe coming from the module.

So. inside the ShellJunctionMediator, remove both of those pipes. Now you have a module, with pipes sticking out of it connected to nothing, floating in memory with no outside references from the main app. Call facade.removeCore passing the multitonKey of the module. Then unload the module. Then call for GC.

-=Cliff>
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #17 on: October 02, 2008, 05:50:54 »

@riafan: http://forums.puremvc.org/index.php?topic=508.msg2165#msg2165

I added the disconnectFitting method as you described, and added a unit test. The latest version of pipes is 1.1

-=Cliff>
Logged
Pages: 1 [2]
Print