Author: ptw
Date: 2008-01-02 14:23:24 -0800 (Wed, 02 Jan 2008)
New Revision: 7705

Modified:
   openlaszlo/branches/wafflecone/
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzReplicationManager.lzs
   
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/svg/LzSprite.js
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/LzIdle.lzs
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LaszloView.lzs
   openlaszlo/branches/wafflecone/lps/components/debugger/newcontent.lzx
   openlaszlo/branches/wafflecone/lps/components/debugger/scrollingtext.lzx
Log:
Change 20080102-ptw-l by [EMAIL PROTECTED] on 2008-01-02 16:13:33 EST
    in /Users/ptw/OpenLaszlo/wafflecone
    for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: Merged revisions 7518,7575 via svnmerge from 
http://svn.openlaszlo.org/openlaszlo/trunk

QA Reviewer: mamye (pending)

Details:
.......
  r7518 | ptw | 2007-12-12 08:13:58 -0500 (Wed, 12 Dec 2007) | 55 lines
  
  Change 20071209-ptw-k by [EMAIL PROTECTED] on 2007-12-09 09:32:18 EST
      in /Users/ptw/OpenLaszlo/ringding-2
      for http://svn.openlaszlo.org/openlaszlo/trunk
  
  Summary: Fix Sprite memory Leaks
  
  Bugs Fixed:
  LPP-5217 'windows can leak memory
  
  Technical Reviewer: [EMAIL PROTECTED] (message://<[EMAIL PROTECTED]>)
  QA Reviewer: [EMAIL PROTECTED] (message://<[EMAIL PROTECTED]>)
  Doc Reviewer: (pending)
  
  Details:
  
      LzMakeLoadSprite.*, LzSprite.*: Eliminate recursion argument.  Not
      used for sprites.
  
      LzSprite.*:  In #destroy set __LZdeleted flag to prevent events
      from resurrecting you.  No need for recursive sprite destruction
      now.  Move delegate removal back to destroy from predestroy.
  
      LzSprite.js:  If parent is not being deleted, remove yourself from
      your parent's childnodes array.
  
      LzIdle: Be careful to create coi Array on instance, not prototype.
  
      LzNode: Comment and simplify $once and $always processing.  Add
      comment to explain importance of __LzDeleted flag.
  
      LaszloView: Destroy the sprite _before_ you check for a recursive
      call.
  
      LzReplicationManager: Remove superfluous call to LzSprite#destroy.
  
      newcontent, scrollingtext: Remove unused id (that causes a leak).
  
  Tests:
      I modified Phil's test case to only create/destroy 1 window per
      click.  The test methodology is:
  
      1. Start test
      2. Click twice to create any shared substrate
      3. Debug.markObjects()
      4. Click once
      5. Debug.findNewObjects()
      6. Debug.whyAlive()
  
      Result: Before change, many leaked window sprites.  After change, no
      leaked window sprites.
  
      NOTE: There are still some other minor leaks that I have not
      attempted to address here, but will report as a separate bug.
.......
  r7575 | ptw | 2007-12-17 20:14:14 -0500 (Mon, 17 Dec 2007) | 25 lines
  
  Change 20071217-ptw-P by [EMAIL PROTECTED] on 2007-12-17 17:56:31 EST
      in /Users/ptw/OpenLaszlo/ringding-2
      for http://svn.openlaszlo.org/openlaszlo/trunk
  
  Summary: Brain-oh in LzSprite.js
  
  Bugs Fixed:
  LPP-5274 'Error: this.__parent has no properties (DHTML)'
  
  Technical Reviewer: [EMAIL PROTECTED] (pending)
  QA Reviewer: maymye (pending)
  
  Details:
      Test for __parent before using it
  
  Tests:
      Environment: OS X, FF2
      Launch laszlo-explorer in flash
      Choose Demos in navbar
      Choose Amazon
      Select the Launch in DHTML button
      Observe green checkmark at bottom right of Amazon window, NO LONGER
      turns to a red X
.......
    

Tests:
    Test case from LPP-5217, Explorer/Demos/Amazon/DHTML




Property changes on: openlaszlo/branches/wafflecone
___________________________________________________________________
Name: svnmerge-integrated
   - 
/openlaszlo/branches/legals:1-5746,5748-5756,5758-5770,5772-5819,5821-5860,5862-5890,5892-6065,6068-6177,6179-6228,6230-6236,6241-6266
 
/openlaszlo/trunk:1-3892,3894-3952,3954-4393,4395-4461,4463-4467,4469-4471,4473-5085,5087-5171,5173-5203,5205-5209,5211-5331,5333-5334,6484-6485,6487,6490-6492,6494-6495,6497,6500-6502,6504-6505,6507-6520,6531-6532,6534-6538,6540-6547,6549,6551-6558,6560-6567,6569-6581,6583-6586,6588,6590-6607,6610-6611,6613-6622,6624-6629,6632-6636,6638-6639,6641-6642,6646-6648,6653,6656-6663,6665-6669,6671-6683,6685-6686,6688-6706,6708-6715,7237
   + 
/openlaszlo/branches/legals:1-5746,5748-5756,5758-5770,5772-5819,5821-5860,5862-5890,5892-6065,6068-6177,6179-6228,6230-6236,6241-6266
 
/openlaszlo/trunk:1-3892,3894-3952,3954-4393,4395-4461,4463-4467,4469-4471,4473-5085,5087-5171,5173-5203,5205-5209,5211-5331,5333-5334,6484-6485,6487,6490-6492,6494-6495,6497,6500-6502,6504-6505,6507-6520,6531-6532,6534-6538,6540-6547,6549,6551-6558,6560-6567,6569-6581,6583-6586,6588,6590-6607,6610-6611,6613-6622,6624-6629,6632-6636,6638-6639,6641-6642,6646-6648,6653,6656-6663,6665-6669,6671-6683,6685-6686,6688-6706,6708-6715,7237,7518-7521,7523-7527,7529,7531-7538,7540-7545,7547-7549,7551-7560,7563-7570,7572,7574-7575

Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs      
2008-01-02 22:08:57 UTC (rev 7704)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs      
2008-01-02 22:23:24 UTC (rev 7705)
@@ -2,7 +2,7 @@
   * LzNode.lzs
   *
   *   *
-  * @copyright Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * @topic LZX
@@ -1254,7 +1254,7 @@
   * @access private
   */
 function __LZresolveRefs ( refs ){
-    //need to resolve init= before constraints...
+    // $once are applied before $always
     for ( var p in refs ){
         var rp = refs[ p ];
         var pp;
@@ -1279,18 +1279,17 @@
                 }
             }
             this.dataBindAttribute( p , pp );
-        } else if ( !('dependencies' in rp && rp.dependencies) ){
-            if (rp instanceof Function) {
-              rp.call(this);
-            }
+        } else if ((rp instanceof Function) &&
+                   // A function with no or null dependencies is a $once
+                   (! ('dependencies' in rp && rp.dependencies))) {
+            rp.call(this);
         }
     }
 
-    // Now resolve the $always values
+    // Functions with dependencies are $always
     for ( var p in refs ){
-        // The string check prevents a dhtml error
         var rp = refs[ p ];
-        if (rp instanceof Function && ('dependencies' in rp)) {
+        if ((rp instanceof Function) && ('dependencies' in rp)) {
             this.applyConstraint( p , rp , rp.dependencies.call(this) );
         }
     }
@@ -1746,7 +1745,7 @@
     if (this.__LZdeleted == true) {
         return;
     }
-
+    // To keep delegates from resurrecting us.  See LzDelegate#execute
     this.__LZdeleted = true;
 
     if (this.ondestroy.ready) this.ondestroy.sendEvent( this );

Modified: 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzReplicationManager.lzs
===================================================================
--- 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzReplicationManager.lzs    
    2008-01-02 22:08:57 UTC (rev 7704)
+++ 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzReplicationManager.lzs    
    2008-01-02 22:23:24 UTC (rev 7705)
@@ -1,6 +1,6 @@
 /**
   *
-  * @copyright Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * @access public
@@ -566,7 +566,6 @@
   * @access private
   */
 function destroyClone ( v ) {
-    v.sprite.destroy(true);
     v.destroy();
 }
 

Modified: 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
===================================================================
--- 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
    2008-01-02 22:08:57 UTC (rev 7704)
+++ 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
    2008-01-02 22:23:24 UTC (rev 7705)
@@ -1,7 +1,7 @@
 /**
   * LzInputTextSprite.js
   *
-  * @copyright Copyright 2007 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2007, 2008 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * @topic Kernel
@@ -200,7 +200,7 @@
 }
 
 LzInputTextSprite.prototype.__textEvent = function ( e, eventname ){
-    if (this.destroyed == true) return;
+    if (this.__LZdeleted == true) return;
     var keycode = e ? e.keyCode : event.keyCode;
     if (eventname == 'onfocus' || eventname == 'onmousedown') {
         LzInputTextSprite.prototype.__focusedSprite = this;         

Modified: 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js     
2008-01-02 22:08:57 UTC (rev 7704)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js     
2008-01-02 22:23:24 UTC (rev 7705)
@@ -1,7 +1,7 @@
 /**
   * LzSprite.js
   *
-  * @copyright Copyright 2007 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2007, 2008 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * @topic Kernel
@@ -1099,16 +1099,22 @@
 LzSprite.prototype.predestroy = function() {
 }
 
-LzSprite.prototype.destroy = function(recursive) {
-    if (this.destroyed == true) return;
-    //alert('destroy' + this + ', recursive ' + recursive);
-    if (recursive) {
-        if (this.__children) {
-            for (var i = 0; i < this.__children.length; i++) {
-                this.__children[i].destroy(recursive);
-            }
+LzSprite.prototype.destroy = function() {
+    if (this.__LZdeleted == true) return;
+    // To keep delegates from resurrecting us.  See LzDelegate#execute
+    this.__LZdeleted = true;
+
+    // Remove from parent if the parent is not going to be GC-ed
+    if ((this.__parent_) && (! this.__parent.__LZdeleted)) {
+      var pc = this.__parent.__children;
+      for (var i = pc.length - 1; i >= 0; i--) {
+        if (pc[i] === this) {
+          pc.splice(i, 1);
+          break;
         }
+      }
     }
+
     if (this.__ImgPool) this.__ImgPool.destroy();
     if (this.__LZimg) this.__discardElement(this.__LZimg);
     if (this.__LZclick) {
@@ -1138,7 +1144,6 @@
         this.__discardElement(this.__LZcanvas);
     }
     this.__ImgPool = null;
-    this.destroyed = true;
 }
 
 /**

Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/svg/LzSprite.js
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/svg/LzSprite.js       
2008-01-02 22:08:57 UTC (rev 7704)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/svg/LzSprite.js       
2008-01-02 22:23:24 UTC (rev 7705)
@@ -1,7 +1,7 @@
 /**
   * LzSprite.js
   *
-  * @copyright Copyright 2007 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2007, 2008 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * @topic Kernel
@@ -471,7 +471,7 @@
     }
 }
 
-LzSprite.prototype.destroy = function(recursive) {
+LzSprite.prototype.destroy = function() {
 }
 
 LzSprite.prototype.getMouse = function(xy) {

Modified: 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as
===================================================================
--- 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as   
    2008-01-02 22:08:57 UTC (rev 7704)
+++ 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as   
    2008-01-02 22:23:24 UTC (rev 7705)
@@ -1,7 +1,7 @@
 /**
   * LzMakeLoadSprite.as
   *
-  * @copyright Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * @topic Kernel
@@ -255,7 +255,7 @@
 /**
   * @access private
   */
-LzMakeLoadSprite.destroy = function (recur) {
+LzMakeLoadSprite.destroy = function () {
     if ('updateDel' in this)
          this.updateDel.unregisterAll();
     if ('errorDel' in this)
@@ -266,5 +266,5 @@
     this.loader.unload( this.loader.mc );
 
     // call shadowed destroy()
-    this.___destroy( recur ); 
+    this.___destroy(); 
 }

Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzSprite.as       
2008-01-02 22:08:57 UTC (rev 7704)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzSprite.as       
2008-01-02 22:23:24 UTC (rev 7705)
@@ -1,7 +1,7 @@
 /**
   * LzSprite.as
   *
-  * @copyright Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * @topic Kernel
@@ -899,18 +899,16 @@
   * @access private
   * 
   */
-LzSprite.prototype.destroy = function(recursive){
-    if (recursive) {
-        if (this.owner.subviews) {
-            for (var i = 0; i < this.owner.subviews.length; i++) {
-                this.owner.subviews[i].sprite.destroy(recursive);
-            }
-        }
-    }
+LzSprite.prototype.destroy = function(){
+    if (this.__LZdeleted == true) return;
+    // To keep delegates from resurrecting us.  See LzDelegate#execute
+    this.__LZdeleted = true;
+
     if (this.updatePlayDel) {
         this.updatePlayDel.unregisterAll();
         delete this.updatePlayDel;
     }
+
     if (this.doQueuedDel) {
         this.doQueuedDel.unregisterAll();
         delete this.doQueuedDel;

Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/LzIdle.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/LzIdle.lzs  
2008-01-02 22:08:57 UTC (rev 7704)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/LzIdle.lzs  
2008-01-02 22:23:24 UTC (rev 7705)
@@ -1,6 +1,6 @@
 /**
   *
-  * @copyright Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * @affects lzidle
@@ -34,12 +34,14 @@
   */
 class LzIdleClass {
 
-var coi = [];
+  var coi;
 
 
 var removeCOI = null;
 function initialize () {
-this.removeCOI = new LzDelegate( this , "removeCallIdleDelegates" );
+  // Create array on instance, not prototype
+  this.coi = new Array;
+  this.removeCOI = new LzDelegate( this , "removeCallIdleDelegates" );
 }
 
 

Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LaszloView.lzs 
2008-01-02 22:08:57 UTC (rev 7704)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LaszloView.lzs 
2008-01-02 22:23:24 UTC (rev 7705)
@@ -1,6 +1,6 @@
 /**
   *
-  * @copyright Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * @affects lzview
@@ -1032,10 +1032,10 @@
 
     super.destroy.apply(this, arguments);
 
+    if (this.sprite) { this.sprite.destroy() }
+
     if ( recursiveCall == true ) { return; }
 
-    if (this.sprite) { this.sprite.destroy(recursiveCall) }
-
     //this.__LZFinishDestroyOnIdle();
 
     this.setVisibility ( "hidden" );

Modified: openlaszlo/branches/wafflecone/lps/components/debugger/newcontent.lzx
===================================================================
--- openlaszlo/branches/wafflecone/lps/components/debugger/newcontent.lzx       
2008-01-02 22:08:57 UTC (rev 7704)
+++ openlaszlo/branches/wafflecone/lps/components/debugger/newcontent.lzx       
2008-01-02 22:23:24 UTC (rev 7705)
@@ -3,7 +3,7 @@
 
  **************************************************************************-->
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2004, 2008 Laszlo Systems, Inc.  All Rights Reserved.         
     *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 
@@ -281,7 +281,7 @@
     <view name="lower_right_corner" bgcolor="#888888" width="11" height="11"
       x="${parent.width-11}" y="${parent.height-11}"/>
 
-    <_dbg_horiz_scrollbar id="dhsb" y="${classroot.textpane.height}"  
+    <_dbg_horiz_scrollbar name="dhsb" y="${classroot.textpane.height}"  
                           width="${parent.width - 11}" 
                           bgcolor="#666666" height="13" />
 

Modified: 
openlaszlo/branches/wafflecone/lps/components/debugger/scrollingtext.lzx
===================================================================
--- openlaszlo/branches/wafflecone/lps/components/debugger/scrollingtext.lzx    
2008-01-02 22:08:57 UTC (rev 7704)
+++ openlaszlo/branches/wafflecone/lps/components/debugger/scrollingtext.lzx    
2008-01-02 22:23:24 UTC (rev 7705)
@@ -281,7 +281,7 @@
     <view name="lower_right_corner" bgcolor="#888888" width="11" height="11"
       x="${parent.width-11}" y="${parent.height-11}"/>
 
-    <_dbg_horiz_scrollbar id="dhsb" y="${parent.content.height-2}"  
+    <_dbg_horiz_scrollbar name="dhsb" y="${parent.content.height-2}"  
                           width="${parent.width - 11}" 
                           bgcolor="#666666" height="13" />
 
@@ -421,7 +421,7 @@
  </class>
 </library>
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2004,2007-2008 Laszlo Systems, Inc.  All Rights Reserved.    *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 <!-- @LZX_VERSION@                                                         -->


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to