Skip to content

Commit

Permalink
Created a way to force cleanup of mediator.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Wright committed Jan 21, 2010
1 parent 3dbeea3 commit 3fecfa4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Binary file modified project/bin/flight-framework.swc
Binary file not shown.
9 changes: 4 additions & 5 deletions project/src/flight/view/Mediator.as
Expand Up @@ -34,9 +34,9 @@ package flight.view
Bind.addBinding(this, target, this, source, twoWay);
}

protected function bindPropertyListener(target:String, listener:Function):void
protected function bindPropertyListener(source:String, listener:Function):void
{
Bind.addListener(listener, this, target);
Bind.addListener(listener, this, source);
}

protected function bindEventListener(type:String, target:String, listener:Function,
Expand All @@ -47,7 +47,7 @@ package flight.view



// parses [Binding(target="target.path")] metadata
// parses [Binding(source="source.path")] metadata
public static function describeBindings(mediator:Mediator):void
{
var desc:XMLList = Type.describeProperties(mediator, "Binding");
Expand All @@ -66,7 +66,7 @@ package flight.view
}
}

// parses [PropertyListener(target="target.path)] metadata
// parses [PropertyListener(source="source.path)] metadata
public static function describePropertyListeners(mediator:Mediator):void
{
var desc:XMLList = Type.describeMethods(mediator, "PropertyListener");
Expand Down Expand Up @@ -99,7 +99,6 @@ package flight.view
tag.arg.(@key == "type").@value :
tag.arg.@value;
var targ:String = tag.arg.(@key == "target").@value;
trace("Methods", mediator[meth.@name], ":", mediator[String(meth.@name)]);
Bind.bindEventListener(type, mediator[meth.@name], mediator, targ);
}
}
Expand Down
9 changes: 8 additions & 1 deletion project/src/flight/view/MediatorMap.as
Expand Up @@ -18,7 +18,13 @@ package flight.view
public class MediatorMap implements IMXMLObject
{
protected var mapping:Dictionary = new Dictionary();
protected var initializedViews:Dictionary = new Dictionary(true);
protected static var initializedViews:Dictionary = new Dictionary(true);


public static function releaseView(view:DisplayObject):void
{
delete initializedViews[view];
}


/**
Expand Down Expand Up @@ -91,6 +97,7 @@ package flight.view
// allow the view to be injected into the mediator
Injector.provideInjection(view, view);
Injector.inject(mediator, view);
Injector.removeInjection(view, view);
return mediator;
}
}
Expand Down

0 comments on commit 3fecfa4

Please sign in to comment.