Phil Thompson <[EMAIL PROTECTED]> wrote: >> Except that this is not totally equivalent: >> - In the C++ version, dlg is a local variable: so it gets deleted >> when we get out of function(). >> - In the Python version, dlg is owned by self: when we get out of >> function(), it is still referenced and won't get garbage collected. A >> workaround to that problem is to reparent the dialog, like this: >> >> def function(self): >> dlg=MyDialog(self) >> dlg.exec_loop() >> dlg.reparent(None, QPoint(0,0)) >> >> The attached Python example demonstrates this. >> >> If there is a better solution, let me know. > > You don't say what versions you are using. I think this was fixed in > v3.15 - at least I don't see any leak in current snapshots.
Yes, I can confirm it was fixed. Though QPopupMenu is exactly in the same situation and it was not fixed: I reported this before. Giovanni Bajo _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde