[fusion-commits] r2645 - in sandbox/adsk/2.3r.sce: layers/MapGuide/php lib widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Sun Feb 24 17:57:40 PST 2013


Author: liuar
Date: 2013-02-24 17:57:40 -0800 (Sun, 24 Feb 2013)
New Revision: 2645

Modified:
   sandbox/adsk/2.3r.sce/layers/MapGuide/php/GetSelectionProperties.php
   sandbox/adsk/2.3r.sce/lib/jxlib.uncompressed.js
   sandbox/adsk/2.3r.sce/widgets/Legend.js
Log:
Submit on behalf of Andy Zhang.
This submission is for SCE project.

Fix IE memory leak and 'zoom to selection' issue.

Modified: sandbox/adsk/2.3r.sce/layers/MapGuide/php/GetSelectionProperties.php
===================================================================
--- sandbox/adsk/2.3r.sce/layers/MapGuide/php/GetSelectionProperties.php	2013-02-22 06:15:35 UTC (rev 2644)
+++ sandbox/adsk/2.3r.sce/layers/MapGuide/php/GetSelectionProperties.php	2013-02-25 01:57:40 UTC (rev 2645)
@@ -61,7 +61,7 @@
         /*holds selection array*/
         $properties = NULL;
         $properties->layers = array();
-        $properties->envelope = NULL;
+        $envelope = new MgEnvelope();
 
         //process
         header('Content-type: application/json');
@@ -163,7 +163,12 @@
         if ($layers && $layers->GetCount() >= 0)
         {
             $result->hasSelection = true;
-            $oExtents = $properties->envelope;
+            if ($geometry != "") {
+                $wktReader = new MgWktReaderWriter();
+                $geomExt = $wktReader->Read($geometry);
+                $envelope = $geomExt->Envelope();
+            }
+            $oExtents = $envelope;
             if ($oExtents)
             {
                 $oMin = $oExtents->GetLowerLeftCoordinate();

Modified: sandbox/adsk/2.3r.sce/lib/jxlib.uncompressed.js
===================================================================
--- sandbox/adsk/2.3r.sce/lib/jxlib.uncompressed.js	2013-02-22 06:15:35 UTC (rev 2644)
+++ sandbox/adsk/2.3r.sce/lib/jxlib.uncompressed.js	2013-02-25 01:57:40 UTC (rev 2645)
@@ -17831,9 +17831,38 @@
         if (!this.domObj) {
             return;
         }
-        //this.domA.removeEvents();
+
+        if (this.checkBox) {
+            OpenLayers.Event.stopObservingElement(this.checkBox);
+            Element.destroy(this.checkBox);
+            this.checkBox = null;
+        }
+        if (this.domLabel) {
+            this.domLabel.removeEvents();
+            this.domLabel.destroy();
+            Element.destroy(this.domLabel);
+            this.domLabel = null;
+        }
+
+        if (this.domImg) {
+            Element.destroy(this.domImg);
+            this.domImg = null;
+        }
+        if (this.domNode) {
+            this.domNode.removeEvents();
+            this.domNode.destroy();
+            Element.destroy(this.domNode);
+            this.domNode = null;
+        }
+        if (this.itemLabelobj) {
+            this.itemLabelobj.destroy();
+            Element.destroy(this.itemLabelobj);
+            this.itemLabelobj = null;
+        }
+        this.domObj.removeEvents();
         this.options = null;
-        this.domObj.dispose();
+        this.domObj.destroy();
+        Element.destroy(this.domObj);
         this.domObj = null;
         this.owner = null;
     },
@@ -17973,7 +18002,8 @@
     finalize: function() {
         this.finalizeFolder();
         this.finalizeItem();
-        this.subDomObj.dispose();
+        this.subDomObj.destroy();
+        Element.destroy(this.subDomObj);
         this.subDomObj = null;
     },
     /**
@@ -17986,7 +18016,6 @@
             this.nodes[i].finalize();
             this.nodes.pop();
         }
-        
     },
     
     /**
@@ -18284,7 +18313,9 @@
      */
     finalize: function() { 
         this.clear(); 
-        this.subDomObj.parentNode.removeChild(this.subDomObj); 
+        this.subDomObj.parentNode.removeChild(this.subDomObj);
+        this.subDomObj.destroy();
+        Element.destroy(this.subDomObj);
     },
     /**
      * Method: clear

Modified: sandbox/adsk/2.3r.sce/widgets/Legend.js
===================================================================
--- sandbox/adsk/2.3r.sce/widgets/Legend.js	2013-02-22 06:15:35 UTC (rev 2644)
+++ sandbox/adsk/2.3r.sce/widgets/Legend.js	2013-02-25 01:57:40 UTC (rev 2645)
@@ -538,7 +538,10 @@
      */
     clear: function() {
         while (this.oRoot.nodes.length > 0) {
-            this.oRoot.remove(this.oRoot.nodes[0]);
+            var node = this.oRoot.nodes[this.oRoot.nodes.length-1];
+            this.oRoot.remove(this.oRoot.nodes[this.oRoot.nodes.length-1]);
+            if (node.finalize)
+                node.finalize();
         }
     },
 



More information about the fusion-commits mailing list