BAD NEWS PEOPLE - Unless what I have found out is not true (I wish)!
I have also been plagued by the deleteChild/deleteFromParent syndrome,
on several occasions and had to resort to work-arounds.
Tonight I came accross it again writting a dynamic explorer-like tree
structure.
I really need to DELETE the children cause the REMOVE acts a bit funny in
Netscape.
Have a look at this...
http://www.faqts.com/knowledge_base/view.phtml/aid/7260/fid/53 and
http://www.faqts.com/knowledge_base/view.phtml/aid/7232/fid/53
they say:
"You can dereference an object (whose memory may then be reclaimed by the
garbage collector) by assigning it to null ("myObject=null"), or by
applying the delete operator to it ("delete myObject"). However, layers
in NN4 are a permanent part of the HTML code, thus they can't be
disposed of. Remember that NN4 only allows modifications to the page
code in loading time, and that every piece of HTML you write (with
document.write()) appears and behaves like if it was hardcoded.
All you can do is hiding them (with
document.layername.visibility='hide'), but that doesn?t help since the
layers are still there for all counts--except that they can't be seen."
and
"You can't deleta a layer, but you can hide it so it will be invisible to
the user. Simply add
document.layers['myLayer'].visibility='hide';
in your script to hide it ('myLayer' is the name of your layer in the
HTML code).
Conversely,
document.layers['myLayer'].visibility='show';
will show your layer again.
This only works in NS4.x."
If this is TRUE, then it is BAD NEWS as I said, and all that's left is
REALLY,
1. scrap Netscape 4.x and concentrate on 6.x or
2. recycle!!
Deli Joannou
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Stephan
Tolksdorf
Sent: 16 June 2001 12:44
To: Robert Rainwater
Subject: Re[3]: [Dynapi-Dev] Attention...
> I will fix the bug soon. However, your fix does not delete the
> object, but the array element.
As I understand it, delete doesn't delete an object but cuts the
variable (or the attribute) and therefore the reference out of the
namescape.
> I believe this would cause a memory
> problems.
That depends on whether local variables get garbage collected after
gone out of scope. I don't think that browsers will have a problem
with this.
But you can still assign null instead of deleting.
__
c.del()
this.children[i] = this.children[l-1];
this.children[l-1] = null;
this.children.length--;
c = null // instead of delete c
__
This would work for Netscape.
Stephan
PS: Didn't want Jeff Greenberg to write a tutorial about memory
optimization?
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev