From: Pascal <pb...@oi...> - 2001-02-21 15:35:23
|
One of the main changes to DynAPI would then be making the DynDocument's child objects of the DynAPI.. then you can destroy the complete DynAPI tree using: destroy(DynAPI) add that to the onunload handler (can it be all that easy!?) Pascal Bestebroer (pb...@oi...) Software ontwikkelaar Oberon Informatiesystemen b.v. http://www.oibv.com > -----Oorspronkelijk bericht----- > Van: dyn...@li... > [mailto:dyn...@li...]Namens Jordi - > IlMaestro > - Ministral > Verzonden: woensdag 21 februari 2001 16:15 > Aan: dyn...@li... > Onderwerp: Re: [Dynapi-Dev] Continuing Freeing memory > > > We could easily have a destroy function > > function destroy(object) { > for(var i in object) destroy(i) > delete object > } > > This would appy to any object, not only DynLayers. Maybe > DynAPI.destroy() or even > destroy(window) and see what happens. > > Richard Emberson wrote: > > > ECMAScript Language Specification > > http://www.ecma.ch/ecma1/stand/ecma-262.htm > > > > ECMAScript Components Specification > > http://www.ecma.ch/ecma1/stand/ecma-290.htm > > > > >From the spec for javascript (Ecma-262): > > > > 8.6.2.5 [[Delete]] (P) > > When the [[Delete]] method of O is called with property > name P, the following > > steps are taken: 1. If O doesn t have a property with name > P, return true. > > 2. If the property has the DontDelete attribute, return false. > > 3. Remove the property with name P from O. > > 4. Return true. > > > > 11.4.1 The delete Operator > > The production UnaryExpression : delete UnaryExpression is > evaluated as > > follows: > > 1. Evaluate UnaryExpression. > > 2. If Type(Result(1)) is not Reference, return true. > > 3. Call GetBase(Result(1)). > > 4. Call GetPropertyName(Result(1)). > > 5. Call the [[Delete]] method on Result(3), providing > Result(4) as the property > > name to delete. > > 6. Return Result(5). > > > > Implimentations of course can vary. > > > > When I wrote my javascript interpreter/compiler 4 years ago > I helped (in a very > > small way) > > in debugging the spec. > > > > Richard Emberson > > > > Pascal wrote: > > > > > so: > > > > > > myLayer = new DynLayer > > > > > > delete myLayer > > > > > > destroys it completely? (or do we have to delete every > object created within > > > the dynlayer object ?) > > > > > > Pascal Bestebroer (pb...@oi...) > > > Software ontwikkelaar > > > Oberon Informatiesystemen b.v. > > > http://www.oibv.com > > > > > > > -----Oorspronkelijk bericht----- > > > > Van: dyn...@li... > > > > [mailto:dyn...@li...]Namens Eytan > > > > Heidingsfeld > > > > Verzonden: woensdag 21 februari 2001 14:20 > > > > Aan: Dynapi-Dev > > > > Onderwerp: [Dynapi-Dev] Continuing Freeing memory > > > > > > > > > > > > Amazing news flash: > > > > Thanx to Bradford Maness and the delete command in JS I found > > > > that if you > > > > delete objects(repeating objects not elements) in IE > memory is freed. > > > > > > > > 8an > > > > > > > > > > > > _______________________________________________ > > > > Dynapi-Dev mailing list > > > > Dyn...@li... > > > > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > > > > > > > > > > _______________________________________________ > > > Dynapi-Dev mailing list > > > Dyn...@li... > > > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > > > > _______________________________________________ > > Dynapi-Dev mailing list > > Dyn...@li... > > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > |