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

Show Posts

| * |

  Show Posts
Pages: [1]
1  PureMVC Manifold / Bug Report / [DEFUSED] Notifier.facade & Junction.removePipe() doesn't disconnect! on: April 06, 2009, 06:23:33
Hi, I'm not sure where to report this bug?

I've got the multicore version up and working and have several cores all interacting using the Pipes interaction. The issue is when disconnecting the pipes and I send a message through Pipes. The core I removed gets rebooted because of the Notifier get facade. So there is two main bugs,
  • removeCore doesn't stop the Notifier get facade from rebooting the Facade
  • removePipe doesn't disconnect the Pipe

The first issue; I had assumed that multitonKey would be set to null when you remove a core, so walking down the tree and nulling multitonKey. This should and would prevent any possibility of the core being used again. I've edited my version to do this, so it cleans up after itself.

The second issue; just removing the IPipeFitting from the pipesMap isn't enough, you have to disconnect the pipe. I don't want to have to disconnect the pipes manually as I would have to store a reference to that and that's just duplicating code unnecessary. So I've edited the removePipe to the following --->

:
public function removePipe( name:String ):void
{
        if ( hasPipe(name) )
        {
                var type:String = pipeTypesMap[name];
                var pipesList:Array;
                switch (type) {
                        case INPUT:
                                pipesList = inputPipes;
                                break;                                         
                        case OUTPUT:
                                pipesList = outputPipes;       
                                break;                                 
                }
                var pipe : IPipeFitting;
                for (var i:int=pipesList.length-1;i>=0;--i){
                        if (pipesList[i] == name){
                                pipe = pipesMap[name] as IPipeFitting;
                                pipe.disconnect();

                                pipesList.splice(i, 1);
                        }
                }
                delete pipesMap[name];
                delete pipeTypesMap[name];
        }
}

This has solved my problem and cleaned up any cores that are hanging on!
Pages: [1]