[PyQt] Simple usage of QListView seems to leak memory in PyQt 3.18.1

Nahuel Greco ngreco at gmail.com
Fri Jun 10 20:18:53 BST 2011


Note, doing:

for i in range(self.list.childCount()):
        i = self.list.firstChild()
        self.list.takeItem(i)
        del i

instead of self.list.clear(), also leaks. Maybe a bug in SIP?

Saludos,
Nahuel Greco.



On Thu, Jun 9, 2011 at 3:35 PM, Nahuel Greco <ngreco at gmail.com> wrote:
> Hi, the attached test seems to leak the QListViewItem's instances. I'm
> using PyQT 3.18.1 /  Python 2.6.6. 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 like that.
>
> script output:
>
> nahuel at 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
> ...
>
>
> Saludos,
> Nahuel Greco.
>


More information about the PyQt mailing list