On Sun, 14 Mar 2004 01:17 am, Patrick Stinson wrote: > why is it that the amount of memory that the following script uses does not > remain constant? > > (mem usage does not change if 'WDestructiveClose'/'w.close()' are omitted) > > a = QApplication([]) > class W(QWidget): > def __init__(self): > QWidget.__init__(self, None, None, Qt.WDestructiveClose) > while 1: > w = W() > w.close()
Taking a wild guess, because w.close() doesn't actually free any memory. Apparently deleting the "this" (of "self" in python) in C++ from inside a method is a big No-No. w.close() probably cues up w for destruction by Qt the next time Qt enters its event loop. Your code never enters the event loop, so your w is never fully deleted. 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
