Author: bargull
Date: 2007-11-28 14:29:02 -0800 (Wed, 28 Nov 2007)
New Revision: 7406

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
   openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs
   openlaszlo/trunk/lps/components/base/basecomponent.lzx
   openlaszlo/trunk/lps/components/base/baseformitem.lzx
   openlaszlo/trunk/lps/components/base/basetabs.lzx
   openlaszlo/trunk/lps/components/base/basetree.lzx
   openlaszlo/trunk/lps/components/base/basewindow.lzx
   openlaszlo/trunk/lps/components/base/submit.lzx
   openlaszlo/trunk/lps/components/lz/basefloatinglist.lzx
Log:
Change 20071025-bargull-2 by [EMAIL PROTECTED] on 2007-10-25 23:59:07
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Bugs related to "destroy"

New Features:

Bugs Fixed:
LPP-4879 - "Memory leak in "LzUtils.callback""

Technical Reviewer: max
QA Reviewer: promanik
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
"LzView#destroy(..)" must call "this.sprite.destroy(true)", otherwise 
subsprites weren't destroyed. Whereas subsprites means a sprite's "__children" 
(DHTML-only). 
Removed "LzNode#__LZsetDefaultHandler(..)": this method is no longer used and 
ptw says it has been overlooked when LPP-3167 was implemented.
Removed "LzSprite#predestroy()" (as): this method was defined two times in 
LzSprite (as), so I've just removed one definition.
Fixed "LzSprite#destroy(..)" (as): unregistering delegates did not work, moved 
to "LzSprite.predestroy(..)".
Updated several components to call "super.destroy.apply(this, arguments)" 
instead of solely "super.destroy()". 


Tests:



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs    2007-11-28 22:23:08 UTC 
(rev 7405)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs    2007-11-28 22:29:02 UTC 
(rev 7406)
@@ -1567,20 +1567,6 @@
 }
 
 /**
-  * @access private
-  */
-function __LZsetDefaultHandler ( eName , func ){
-    var defHandleName = "_handle" + eName;
-    this[ defHandleName ] = func;
-    var d = new LzDelegate(this, defHandleName , this, eName  );
-    if ( !this.__LZhandlers ){
-        this.__LZhandlers = [ d ];
-    } else {
-        this.__LZhandlers.push( d );
-    }
-}
-
-/**
   * A list of CSS property names and values that configure the
   * behavior of objects, such as data binding and view layouts, that
   * operate on this view.

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as     2007-11-28 
22:23:08 UTC (rev 7405)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as     2007-11-28 
22:29:02 UTC (rev 7406)
@@ -878,10 +878,6 @@
     s.addedToParent = true;
 }
 
-LzSprite.prototype.predestroy = function(){
-    this.bringToFront();
-}
-
 /**
   * Sets the <attribute>rotation</attribute> for the view to the given value.
   * @param Number v: The new value for <attribute>rotation</attribute>.
@@ -901,6 +897,16 @@
 
 LzSprite.prototype.predestroy = function(){
     this.bringToFront();
+    
+    if (this.updatePlayDel) {
+        this.updatePlayDel.unregisterAll();
+        delete this.updatePlayDel;
+    }
+    
+    if (this.doQueuedDel) {
+        this.doQueuedDel.unregisterAll();
+        delete this.doQueuedDel;
+    }
 }
 
 /**
@@ -909,21 +915,17 @@
   * 
   */
 LzSprite.prototype.destroy = function(recursive){
-    if (recursive) {
+    /* This does not work!
+     * -> Every subview of this sprite's owner has already removed itself, see 
LzView#destroy(..). 
+     * Therefore "this.owner.subviews" will be an empty array at this stage!
+     */
+    /*if (recursive) {
         if (this.owner.subviews) {
             for (var i = 0; i < this.owner.subviews.length; i++) {
                 this.owner.subviews[i].sprite.destroy(recursive);
             }
         }
-    }
-    if (this.updatePlayDel) {
-        this.updatePlayDel.unregisterAll();
-        delete this.updatePlayDel;
-    }
-    if (this.doQueuedDel) {
-        this.doQueuedDel.unregisterAll();
-        delete this.doQueuedDel;
-    }
+    }*/
 
     this.__LZFinishDestroyOnIdle();
 }

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs       2007-11-28 
22:23:08 UTC (rev 7405)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs       2007-11-28 
22:29:02 UTC (rev 7406)
@@ -1159,7 +1159,7 @@
 
     if ( recursiveCall == true ) { return; }
 
-    if (this.sprite) { this.sprite.destroy(recursiveCall) }
+    if (this.sprite) { this.sprite.destroy(true) }
 
     //this.__LZFinishDestroyOnIdle();
 

Modified: openlaszlo/trunk/lps/components/base/basecomponent.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/basecomponent.lzx      2007-11-28 
22:23:08 UTC (rev 7405)
+++ openlaszlo/trunk/lps/components/base/basecomponent.lzx      2007-11-28 
22:29:02 UTC (rev 7406)
@@ -360,7 +360,7 @@
                 this._styledel.unregisterAll();
                 delete this._styledel;
             }
-            super.destroy();
+            super.destroy.apply(this, arguments);
         </method>
 
         <!--- @access private -->

Modified: openlaszlo/trunk/lps/components/base/baseformitem.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/baseformitem.lzx       2007-11-28 
22:23:08 UTC (rev 7405)
+++ openlaszlo/trunk/lps/components/base/baseformitem.lzx       2007-11-28 
22:29:02 UTC (rev 7406)
@@ -57,7 +57,7 @@
         <method name="destroy">
             if (this._parentform)
                 this._parentform.removeFormItem(this);
-            super.destroy();
+            super.destroy.apply(this, arguments);
         </method>
         
         <handler name="oninit"><![CDATA[

Modified: openlaszlo/trunk/lps/components/base/basetabs.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/basetabs.lzx   2007-11-28 22:23:08 UTC 
(rev 7405)
+++ openlaszlo/trunk/lps/components/base/basetabs.lzx   2007-11-28 22:29:02 UTC 
(rev 7406)
@@ -63,7 +63,7 @@
                     }
                 }
             }
-            super.destroy();
+            super.destroy.apply(this, arguments);
         ]]>
         </method>
 

Modified: openlaszlo/trunk/lps/components/base/basetree.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/basetree.lzx   2007-11-28 22:23:08 UTC 
(rev 7405)
+++ openlaszlo/trunk/lps/components/base/basetree.lzx   2007-11-28 22:29:02 UTC 
(rev 7406)
@@ -168,7 +168,7 @@
                 this.openChildren (false);
                 this.children.destroy();
             }
-            super.destroy();
+            super.destroy.apply(this, arguments);
         </method>
 
         <!--- Method to recurse and create subtrees when replicating data. 

Modified: openlaszlo/trunk/lps/components/base/basewindow.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/basewindow.lzx 2007-11-28 22:23:08 UTC 
(rev 7405)
+++ openlaszlo/trunk/lps/components/base/basewindow.lzx 2007-11-28 22:29:02 UTC 
(rev 7406)
@@ -104,7 +104,7 @@
           if (this.mousedel) {
               this.mousedel.unregisterAll();
           }
-          super.destroy();
+          super.destroy.apply(this, arguments);
         </method>
         
         <method name="sendInFrontOf" args="v"> <![CDATA[

Modified: openlaszlo/trunk/lps/components/base/submit.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/submit.lzx     2007-11-28 22:23:08 UTC 
(rev 7405)
+++ openlaszlo/trunk/lps/components/base/submit.lzx     2007-11-28 22:29:02 UTC 
(rev 7406)
@@ -102,7 +102,7 @@
         <!--- @access private -->
         <method name="destroy">
             this._clearDels();
-            super.destroy();
+            super.destroy.apply(this, arguments);
         </method>
         
         <doc>

Modified: openlaszlo/trunk/lps/components/lz/basefloatinglist.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/basefloatinglist.lzx     2007-11-28 
22:23:08 UTC (rev 7405)
+++ openlaszlo/trunk/lps/components/lz/basefloatinglist.lzx     2007-11-28 
22:29:02 UTC (rev 7406)
@@ -102,7 +102,7 @@
               break;
             }
           }
-          super.destroy(recursiveCall);
+          super.destroy.apply(this, arguments);
         </method>
 
         <!--- @keywords private -->


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

Reply via email to