Subj : Re: JS_GetArrayLength() crashing (garbage collection issue) To : netscape.public.mozilla.jseng From : smaraux Date : Mon Feb 28 2005 06:25 am smaraux@caramail.com (sebastien maraux) wrote in message news:<6abe14de.0502280305.2d8fd16a@posting.google.com>... > Looking at parent / child relationship in JS : > > If a child must be replaced by another, how can I destroy the replaced > object ? > As the GC see that this object has a parent, it won't erase it. > Moreover I would like to erase it right when I replace it, without > having to call GC, but I don't find any delete function for this. Or > can I call SetParent(NULL) on it ? > > Thanks for your answers. Moreover, I also store doubles and strings as arrays in the same way (attached private data containing vrml field). In this case, I cannot use parent relationship to insure correct memory management, can I ? .