On Saturday 10 April 2004 05:28, Tuvi, Selim wrote:
> I am experiencing memory leak like behavior when I use the instantiation 
method of opening a file with QFileDialog under Windows XP.

> Attached is a modified version of the application.py script. If I click on 
"Open File" toolbar icon and escape out about 8 times then the task manager 
memory usage increases by about 1Kbytes. 

Each time load() runs it creates and uses a new object. The "leak like" 
behaviour is the bunch of object in memory.

> I tried deleting the object after usage but that didn't change the outcome.

'del' does actually delete the object like in C++. 'del breaks the reference 
from that variable to the object. When python feels like it, it will clean up 
and free memory.

> If I go back to using QFileDialog.getOpenFileName instead then I don't 
observe the memory increase.

QFileDialog.getOpenFileName doesn't create a new object. Therefore you don't 
get a build up of objects.

cheers,

-- 
Simon Edwards             | Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | "ZooTV? You made the right choice."

_______________________________________________
PyKDE mailing list    [EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to