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

Key: LPP-1952
Type: Bug Bug
Status: Verified Verified
Resolution: Fixed
Priority: -- --
Assignee: Unassigned
Reporter: Denis Bohm
Votes: 0
Watchers: 0
Operations

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

destroy before resource is loaded leads to full load queue and hang

Created: 12/Apr/06 10:57 AM   Updated: 22/Oct/07 11:39 AM
Component/s: Client Cache
Affects Version/s: 3.2 (Sage), 3.3.3
Fix Version/s: Contribute, 4.0.5WaffleCone

Time Tracking:
Not Specified

File Attachments: 1. File LPP-1952.lzx (2 kb)


Severity: Critical
Fixed in Change#: 6,259
Runtime: N/A
Fix in hand: False


 Description  « Hide
It looks like the hang occurs because destroy does not unload the request from the load queue. See the example below. If you click quick enough on the "new" button, before all the views have loaded, then you will see a hang if you comment out the indicated line.

<canvas>

   <simplelayout axis="y"/>
   <button text="new">
       <method event="onclick"><![CDATA[
           // remove old views
           var subviews = content.subviews;
           for (var i = subviews.length - 1; i >= 0; --i) {
               var view = subviews[i];
               // comment out next line to see bug
               LzLoadQueue.unloadRequest(view.loader.mc);
               view.destroy();
           }
                     // add some new views
           for (var i = 0; i < 10; ++i) {
               new LzView(parent.content, {resource: "http:icons/star.png"});
           }
       ]]></method>
   </button>
   <button text="print debug">
       <method event="onclick"><![CDATA[
           Debug.inspect(LzLoadQueue.loading);
           for (var i = 0; i < LzLoadQueue.listofqs.length; ++i) {
               var q = LzLoadQueue.listofqs[i];
               if (q != undefined) {
                   for (var j = q.length - 1; j >= 0; --j) {
                       var mediaLoadObj = q[j];
                       var loader = mediaLoadObj.loader;
                       Debug.inspect(mediaLoadObj);
                   }
               }
           }
       ]]></method>
   </button>

   <view name="content">
       <simplelayout axis="x"/>
   </view>
  </canvas>
_______________________________________________
Laszlo-dev mailing list
Laszlo-dev@openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jason Stafford - 10/Jul/06 07:36 PM
I have a fix for this as soon as I get my contributor agreement approved.

Jason Stafford - 28/Jul/06 03:04 PM
For those of you who can't wait for the lawyers at my company:

Look in LzMakeLoad.as (openlaszlo/WEB-INF/lps/lfc/transformers).

There are two calls to this.loader.unload.

If you look at the source for unload (in LzLoader.as), you will see that it really ought to be passed a parameter.

In these two cases I think that parameter should be this.loader.mc.

You can fix this bug without recompiling the source.

If in a script block you have a few lines like:
LzMakeLoad.unload = function () {
   // do some stuff
}

You can simply overwrite that function and your code will be executed instead of the compiled in code. (Isn't JavaScript cool).

I'm sorry to not be more plain spoken about the fix, but I don't want to cloud the copyright issue by showing the fix without a contributor agreement in place. I swear I'm really doing all I can to get that done - but while I'm at work I don't own my output, the company does. I've got to get their OK.

-Jason

sanjaya lai - 11/Jan/07 04:43 PM
This issue is also reproduceable in LPS 3.3.3
Following is the workaround based on Jason's hints (thanks!).

Sanjaya
================================

    <script>
        //***To workaround the hangging media loader after destroy view whose loading in progress,
             apply this script block in your app
        ***/

        //-----------------------------------------------------------------------------
        // Unloads the media
        //
        // @keywords private
        //-----------------------------------------------------------------------------
        LzMakeLoad.unload = function () {
            this.loader.unload( this.loader.mc );
        }
        
        
        
        //=============================================================================
        // @keywords private
        //=============================================================================
        LzMakeLoad.destroy = function (recur) {
            
            this.loader.unload( this.loader.mc );
        
            super.destroy( recur );
        }
    </script>

Henry Minsky - 22/Aug/07 01:09 PM
out for review to max

Benjamin Shine - 10/Sep/07 09:13 PM
Fix was checked in to wafflecone, so I'm marking it as fix-version wafflecone

Henry Minsky - 11/Sep/07 06:55 AM
r6259 | hqm | 2007-08-27 20:35:33 -0400 (Mon, 27 Aug 2007) | 30 lines
Changed paths:
   M /openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as

Change 20070827-hqm-4 by hqm@IBM-2E06404CB67 on 2007-08-27 20:32:51 EDT
    in /cygdrive/c/users/hqm/openlaszlo/wafflecone
    for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: fix for media loader bug

New Features:

Bugs Fixed: LPP-1952
Bug: LPP-1952

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

Documentation:

Release Notes:

Details:

see bug report


Tests:

test case in bug report

Steve O'Sullivan - 22/Oct/07 11:39 AM
Tested on Firefox 2.0.0.8 and IE7 on Windows using r6938 showed no hang with the line in question commented out. Bug verified.