History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-4432
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: -- --
Assignee: Steve O'Sullivan
Reporter: André Bargull
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Memory leaks in "basetabelement"

Created: 04/Aug/07 05:48 AM   Updated: 26/Oct/07 03:49 PM
Component/s: Components - base
Affects Version/s: 4.0.3
Fix Version/s: 4.0.5WaffleCone

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 6,164
Runtime: N/A
Flags: External
Fix in hand: True


 Description  « Hide
Memory may leak for <basetabelement> due to non-unregistering LzDelegates.
Proposed changes:

"basetabelement#openned()":
[code]
<!--- Called when the tabelement is completely opened. -->
<method name="openned">
    if ( onopenstop ) this.onopenstop.sendEvent();
    this.isopening -= 1;
    if (this.isopening == 0) {
        //now we can savely call unregisterAll
        if (this.dlo) {
            this.dlo.unregisterAll();
        }
    }
</method>
[/code]

and

"basetabelement#destroy()":
[code]
<!--- @keywords private -->
<method name="destroy" ><![CDATA[
    if (this.dlo) {
        this.dlo.unregisterAll();
        delete this.dlo;
    }
    
    if (this.dlc) {
        this.dlc.unregisterAll();
        delete this.dlc;
    }
    
    super.destroy.apply(this, arguments);
]]></method>
[/code]

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Max Carlson - 20/Aug/07 09:09 PM
Author: max
Date: 2007-08-20 19:27:44 -0700 (Mon, 20 Aug 2007)
New Revision: 6164

Modified:
   openlaszlo/branches/wafflecone/lps/components/base/basetabelement.lzx
Log:
Change 20070820-maxcarlson-u by maxcarlson@plastik on 2007-08-20 17:32:03 PDT
    in /Users/maxcarlson/openlaszlo/wafflecone
    for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: Fix memory leaks in "basetabelement"

New Features:

Bugs Fixed: LPP-4432 - Memory leaks in "basetabelement"

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

Documentation:

Release Notes:

Details: Applied fixes per LPP-4432.
    

Tests: http://localhost:8080/wafflecone/examples/components/tabs_example.lzx and http://localhost:8080/wafflecone/test/components/base/lzunit-basetabs.lzx pass in swf and dhtml.



Modified: openlaszlo/branches/wafflecone/lps/components/base/basetabelement.lzx
===================================================================
--- openlaszlo/branches/wafflecone/lps/components/base/basetabelement.lzx 2007-08-21 00:45:08 UTC (rev 6163)
+++ openlaszlo/branches/wafflecone/lps/components/base/basetabelement.lzx 2007-08-21 02:27:44 UTC (rev 6164)
@@ -131,6 +131,12 @@
         <method name="openned">
             if ( onopenstop ) this.onopenstop.sendEvent();
             this.isopening -= 1;
+ if (this.isopening == 0) {
+ //now we can savely call unregisterAll
+ if (this.dlo) {
+ this.dlo.unregisterAll();
+ }
+ }
         </method>
 
         <!--- Called when the tabelement is completely closed. -->
@@ -151,6 +157,22 @@
                 this.updateDefault();
             }
         ]]></method>
+
+ <!--- @keywords private -->
+ <method name="destroy" ><![CDATA[
+ if (dlo in this) {
+ this.dlo.unregisterAll();
+ delete this.dlo;
+ }
+
+ if (dlc in this) {
+ this.dlc.unregisterAll();
+ delete this.dlc;
+ }
+
+ super.destroy.apply(this, arguments);
+ ]]></method>
+
         <doc>
           <tag name="shortdesc"><text>Base class for the contents of a basetabslider.</text></tag>
           <text>


_______________________________________________
Laszlo-checkins mailing list
Laszlo-checkins@openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins