Package: python-qt3
Version: 3.18.1-4.1
Severity: normal
The attached test seems to leak all the QListViewItem's instances. Note this is
a simple usage,
I'm only creating QListViewItem's and doing a QListView::clear() to delete
them, not
subclassing QListViewItem or something fancy like that.
script output:
nahuel@serge:/tmp$ ./qlist_leak.py
Python Version: 2.6.6 (r266:84292, Apr 20 2011, 11:58:30)
[GCC 4.5.2]
PyQt Version: 3.18.1
VmRss: 13664 Kb list.childcount(): 0
VmRss: 13744 Kb list.childcount(): 0
VmRss: 13900 Kb list.childcount(): 0
VmRss: 14048 Kb list.childcount(): 0
VmRss: 14196 Kb list.childcount(): 0
VmRss: 14344 Kb list.childcount(): 0
VmRss: 14496 Kb list.childcount(): 0
VmRss: 14644 Kb list.childcount(): 0
VmRss: 14792 Kb list.childcount(): 0
VmRss: 14940 Kb list.childcount(): 0
VmRss: 15124 Kb list.childcount(): 0
VmRss: 15276 Kb list.childcount(): 0
VmRss: 15424 Kb list.childcount(): 0
VmRss: 15572 Kb list.childcount(): 0
VmRss: 15720 Kb list.childcount(): 0
...
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.38-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash
Versions of packages python-qt3 depends on:
ii libc6 2.13-4 Embedded GNU C Library: Shared lib
ii libgcc1 1:4.6.0-10 GCC support library
ii libqt3-mt 3:3.3.8b-8 Qt GUI Library (Threaded runtime v
ii libstdc++6 4.6.0-10 The GNU Standard C++ Library v3
ii libx11-6 2:1.4.3-1 X11 client-side library
ii libxext6 2:1.3.0-1 X11 miscellaneous extension librar
ii python 2.6.6-14 interactive high-level object-orie
ii python-sip [sip-api-8.1] 4.12.1-1+b2 Python/C++ bindings generator runt
ii python-support 1.0.13 automated rebuilding support for P
python-qt3 recommends no packages.
Versions of packages python-qt3 suggests:
pn libqt3-mt-mysql | libqt3-mt-o <none> (no description available)
pn python-qt3-doc <none> (no description available)
pn python-qt3-gl <none> (no description available)
-- no debconf information
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
#
# Leaks with Python 2.6.6 PyQT 3.18.1
#
import sys
from qt import *
class Main(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
self.list = QListView(self, 'list')
self.list.addColumn("Col1")
self.list.addColumn("Col2")
self.resize(QSize(150,300).expandedTo(self.minimumSizeHint()))
self.list.resize(QSize(150,300).expandedTo(self.minimumSizeHint()))
self.refresh_count = 0
QTimer.singleShot(1, self.refresh)
def refresh(self):
# This must delete all the QListViewItems, but they seems to leak
self.list.clear()
self.refresh_count += 1
if not (self.refresh_count % 1000):
for l in open('/proc/self/status','r').readlines():
if l.startswith('VmRSS:'):
print "VmRss: %d Kb" % int(l.split()[1]),
break
print "list.childcount():", self.list.childCount()
# Create the leaky item
QListViewItem(self.list, "1", "2")
QTimer.singleShot(1, self.refresh)
print "Python Version:", sys.version
print "PyQt Version:", PYQT_VERSION_STR
app = QApplication(sys.argv)
w = Main()
app.setMainWidget(w)
w.show()
app.exec_loop()
_______________________________________________
Python-modules-team mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team