Updated Branches:
  refs/heads/develop 5c93a552b -> 6bd6b9748

FLEX-33893 CSS memory / performance fix


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/6bd6b974
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/6bd6b974
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/6bd6b974

Branch: refs/heads/develop
Commit: 6bd6b9748c0d364af2f1e2f41422e780934bf5fc
Parents: 5c93a55
Author: Justin Mclean <[email protected]>
Authored: Sun Dec 29 09:00:51 2013 +1100
Committer: Justin Mclean <[email protected]>
Committed: Sun Dec 29 09:00:51 2013 +1100

----------------------------------------------------------------------
 .../src/mx/styles/CSSStyleDeclaration.as        | 22 +++++++-------------
 1 file changed, 8 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/6bd6b974/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as 
b/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as
index 0c43ed1..6f72e70 100644
--- a/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as
+++ b/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as
@@ -113,6 +113,11 @@ public class CSSStyleDeclaration extends EventDispatcher
      *  @private
      */
     private static const FILTERMAP_PROP:String = "__reserved__filterMap";
+    
+    /**
+     *  @private
+     */
+    private static var emptyObjectFactory:Function = function():void {};
         
     
//--------------------------------------------------------------------------
     //
@@ -934,9 +939,6 @@ public class CSSStyleDeclaration extends EventDispatcher
             if (addedParentStyleToProtoChain)
             {
                 // There are parent styles so create an empty node.
-                var emptyObjectFactory:Function = function():void
-                {
-                };
                 emptyObjectFactory.prototype = chain;
                 chain = new emptyObjectFactory();
                 emptyObjectFactory.prototype = null;
@@ -994,10 +996,8 @@ public class CSSStyleDeclaration extends EventDispatcher
         
         // If there's a factory for this style sheet,
         // then add the object it produces to the chain.
-        var objectFactory:Object = null;
         if (factory != null)
         {
-            objectFactory = new factory();
             factory.prototype = chain;
             chain = new factory();
             factory.prototype = null;
@@ -1013,9 +1013,6 @@ public class CSSStyleDeclaration extends EventDispatcher
             // of the chain.
             if (factory == null)
             {
-                var emptyObjectFactory:Function = function():void
-                {
-                };
                 emptyObjectFactory.prototype = chain;
                 chain = new emptyObjectFactory();
                 emptyObjectFactory.prototype = null;
@@ -1052,12 +1049,9 @@ public class CSSStyleDeclaration extends EventDispatcher
     {
         var filteredChain:Object = {};
         // Create an object on the head of the chain using the original chain  
     
-        var filterObjectFactory:Function = function():void
-        {
-        };
-        filterObjectFactory.prototype = originalChain;
-        filteredChain = new filterObjectFactory();
-        filterObjectFactory.prototype = null;
+        emptyObjectFactory.prototype = originalChain;
+        filteredChain = new emptyObjectFactory();
+        emptyObjectFactory.prototype = null;
         
         for (var i:String in chain)
         {

Reply via email to