From: Bruce S. <Bru...@nc...> - 2007-01-03 23:43:27
|
That should free up memory eventually, when Python does garbage=20 collection. Python keeps a reference count on all objects (and Visual=20 adds another one if the object is visible, because the human user=20 constitutes another reference to the object, which is why you have to=20 make the object invisible before deleting it). When the reference count=20 goes to zero, Python can delete the data from memory., At least that's=20 the way it's SUPPOSED to work. Bruce Jos=E9 Antonio Mart=EDn H wrote: > Hi, by the way what happends with this code ? > that is, is the memory freed after each initialization ? > > self.Gtrajectory =3D gcurve(gdisplay=3Dself.clwindow,color=3Dcolor.yell= ow) > > do some plot operation on self.Gtrajectory > > > self.Gtrajectory.gcurve.visible =3D False > del self.Gtrajectory > self.Gtrajectory =3D gcurve(gdisplay=3Dself.clwindow,color=3Dcolor.yell= ow) > > > This code cleans the graphic object gcurve but i am not sure that the=20 > memory is freed > > It this code cleaning the memory too ? > > Is there any other way of cleaning a gcurve object ? > > Kind regards. > jose > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Jose Antonio Martin H. > Departamento de Sistemas Inform=E1ticos y Computaci=F3n > Facultad de Inform=E1tica > Universidad Complutense de Madrid > Ciudad universitaria, 28040 Madrid > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > |