On Fri, 2008-05-23 at 16:52 +0200, Arne de Bree wrote:
> Hi Jesse,
> 
> One way of doing this I picked up on the Laszlo forum which claimed to
> be the only memory leak safe way of empty'ing datasets


  Using setData([]) is quick and easy and seems to do what I want .. I
suppose I should load up then clear a dataset via setData() in a loop
and see if memory use continues to grow.



>  which is basicaly
> your own conclusion in your last paragraph:
> 
> 
> var dsPntr = dsProspect.getPointer();
> 
> while( dsPntr.p.hasChildNodes() ) {
>   dsPntr.p.removeChild( dsPntr.p.getFirstChild() );
> }
> 
> dsPntr.destroy()
> 
> 
> Not sure who made the original post...
> 
> Gr, Arne
> 
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:laszlo-user-
> > [EMAIL PROTECTED] On Behalf Of Jesse Norell
> > Sent: donderdag 22 mei 2008 19:35
> > To: Laszlo
> > Subject: [Laszlo-user] emptying a dataset
> > 
> > Hello,
> > 
> >   What is the proper way to empty a dataset?  If I use
> setChildNodes([])
> > it seems to do what I want, except inspecting the dataset shows "data"
> > still holds the old values.  Maybe that's not a problem?  I could
> follow
> > up the setChildNodes() with a datasetname.data=[], but I don't know if
> > that's a bad thing to do or not (has side effects?  memory leaks?).
> > (And a maybe related question: do you need to worry about memory leaks
> > in openlaszlo apps?)
> > 
> >   I've also tried to use destroy() and assign a new LzDataset(), but
> the
> > databound components don't work after that.
> > 
> >   I imagine you could loop through the entire dataset calling
> > removeChild() on each child node, but I suspect that would be
> > inefficient for large datasets.
> > 
> > Thanks,
> > Jesse
> > 
> > 
> > --
> > Jesse Norell
> > Kentec Communications, Inc.
> > [EMAIL PROTECTED]
-- 
Jesse Norell
Kentec Communications, Inc.
[EMAIL PROTECTED]

Reply via email to