[Laszlo-dev] destroy http resource loading view hangs application

Denis Bohm denis at fireflydesign.com
Mon Jan 30 10:41:24 PST 2006


For each view that hasn't loaded and has been destroyed there seems to 
be one of these still in the load queue:

«¿movieclip?#0»

If the view hasn't been destroyed and is still loading there is one of 
these:

«MediaLoadObj#0| http:icons/star.png (initialized)» {
  _dbg_name: «Function#1| loadobj._dbg_name»
  _dbg_typename: MediaLoadObj
  data: null
  loaded: false
  loader: «LzMediaLoader#2| «MediaLoadObj#0| http:icons/star.png 
(initialized)...»
  loading: false
  lzt: media
  mc: «MediaLoadObj#0| http:icons/star.png (initialized)»
  proxied: true
  reqobj: «Object#3| {lzr: swf8, proxied: true, ccache: true, cache: 
true, url...»
  secure: false
  secureport: null
  seqnum: 1
  timedout: false
  timeout: 30000
  valid: true
}

So it seems like destroying a view that hasn't finished loading leaves 
behind that movieclip in the queue...

Denis Bohm wrote:
> I tried that also - it doesn't seem to work either.  Other ideas?
>
> Henry Minsky wrote:
>> You probably want to call
>>
>> loader.unload( mediaLoadObj);
>>
>> So that 'this' is bound to what it expects.
>>
>>
>>
>> On 1/30/06, *Denis Bohm* < denis at fireflydesign.com 
>> <mailto:denis at fireflydesign.com>> wrote:
>>
>>     I tried the code below, but it doesn't seem to work.  Is that the
>>     right thing to do?
>>
>>     <canvas>
>>
>>         <simplelayout axis="y"/>
>>         <button text="click me">
>>             <method event="onclick"><![CDATA[
>>                 // remove old subviews
>>                 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);
>>                             LzMediaLoader.prototype.unload(mediaLoadObj);
>>                         }
>>                     }
>>                 }
>>                 var subviews = content.subviews;
>>                 for (var i = subviews.length - 1; i >= 0; --i) {
>>                     var view = subviews[i];
>>                     Debug.write(view.loader);
>>                     view.destroy();
>>                 }
>>                
>>                 // add some new ones
>>                 for (var i = 0; i < 10; ++i) {
>>                     new LzView(parent.content, {resource:
>>     "http:icons/star.png" <http:icons/star.png>});
>>                 }
>>             ]]></method>
>>         </button>
>>         <view name="content">
>>             <simplelayout axis="x"/>
>>         </view>
>>        
>>     </canvas>
>>
>>     Henry Minsky wrote:
>>>     Loading of a resource or data is managed by the LzLoader class.
>>>
>>>     There is a way to remove a load request from the load queue,
>>>     which is used by
>>>     the timeout code in LzLoader.
>>>
>>>     You need to call LzLoader.prototype.unload , but the arg it
>>>     takes is a "load object" which  you need to get your hands on.
>>>
>>>     For media loads, I believe this will get it for you:
>>>
>>>     LzMediaLoader.prototype.getLoadMC
>>>
>>>     (LzMediaLoader is a subclass of LzLoader)
>>>
>>>
>>>     However for data loads, something else needs to be done to get
>>>     your hands on the
>>>     "load object" from an LzLoader.
>>>
>>>
>>>
>>>     On 1/30/06, * Denis Bohm* <denis at fireflydesign.com
>>>     <mailto:denis at fireflydesign.com>> wrote:
>>>
>>>         I added the code below in the onclick method and it appears
>>>         that when a
>>>         view is destroyed, it's loader is not taken out of the load
>>>         queue - so
>>>         the load never finishes.  The load queue is then stuck and
>>>         no more loads
>>>         occur.  I tried calling view.unload, but it doesn't appear
>>>         to work.
>>>         Anyone know how to remove something out of the load queue
>>>         properly?
>>>
>>>                     for (var i = 0; i < LzLoadQueue.listofqs.length;
>>>         ++i) {
>>>                         Debug.write(LzLoadQueue.listofqs[i].length);
>>>                     }
>>>
>>>         P T Withington wrote:
>>>         > I can believe there is a bug there.  Try setting
>>>         > LzLoader.__LZMonitorState to true.  This will trace the
>>>         load queue in
>>>         > the debugger.  Perhaps that will reveal something.
>>>         >
>>>         > On 30 Jan 2006, at 01:41, Denis Bohm wrote:
>>>         >
>>>         >> The program below removes the images from a container and
>>>         then loads
>>>         >> ten images when you click the button.  If you wait for all
>>>         the images
>>>         >> to load then it works fine.  If you click before all the
>>>         images are
>>>         >> loaded it hangs.  Am I doing something wrong or is this a bug?
>>>         >>
>>>         >> <canvas>
>>>         >>
>>>         >>    <simplelayout axis="y"/>
>>>         >>    <button text="click me">
>>>         >>        <method event="onclick"><![CDATA[
>>>         >>            // remove old subviews
>>>         >>            var subviews = content.subviews ;
>>>         >>            for (var i = subviews.length - 1; i >= 0; --i) {
>>>         >>                var view = subviews[i];
>>>         >>                view.destroy();
>>>         >>            }
>>>         >>                       // add some new ones
>>>         >>            for (var i = 0; i < 10; ++i) {
>>>         >>                new LzView(parent.content, {resource:
>>>         >> "http:icons/star.png" <http:icons/star.png>});
>>>         >>            }
>>>         >>        ]]></method>
>>>         >>    </button>
>>>         >>    <view name="content">
>>>         >>        <simplelayout axis="x"/>
>>>         >>    </view>
>>>         >>    </canvas>
>>>         >> _______________________________________________
>>>         >> Laszlo-dev mailing list
>>>         >> Laszlo-dev at openlaszlo.org <mailto:Laszlo-dev at openlaszlo.org>
>>>         >> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
>>>         <http://www.openlaszlo.org/mailman/listinfo/laszlo-dev>
>>>         >
>>>         >
>>>
>>>         _______________________________________________
>>>         Laszlo-dev mailing list
>>>         Laszlo-dev at openlaszlo.org <mailto:Laszlo-dev at openlaszlo.org>
>>>         http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
>>>
>>>
>>>
>>>
>>>     -- 
>>>     Henry Minsky
>>>     Software Architect
>>>     hminsky at laszlosystems.com <mailto:hminsky at laszlosystems.com>
>>>
>>
>>
>>
>>
>> -- 
>> Henry Minsky
>> Software Architect
>> hminsky at laszlosystems.com <mailto:hminsky at laszlosystems.com>
>>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Laszlo-dev mailing list
> Laszlo-dev at openlaszlo.org
> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openlaszlo.org/pipermail/laszlo-dev/attachments/20060130/2e437ca0/attachment.html


More information about the Laszlo-dev mailing list