[PyKDE] Memory leak in QFileDialog?
Simon Edwards
simon at simonzone.com
Sat Apr 10 08:52:01 BST 2004
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
simon at simonzone.com | http://www.simonzone.com/software/
Nijmegen, The Netherlands | "ZooTV? You made the right choice."
More information about the PyQt
mailing list