[wxPython] memory leak in wxTreeCtrl sort?

The test:

in wxPython demo/wxTreeCtrl.py add the following line of code at the end
of TestTreeCtrlPanel __init__ function:

self.tree.SortChildren (self.root)

from now on whenever the wxTreeCtrl demo is executed, some memory is
allocated and never released. Switch multiple times between this and
other demos and watch memory growing. I reproduced this problem on
version 2.3.2.1 and 2.3.3p4 of wxPython either on Linux/GTK and on
Win2K, with the demo and with an application I'm developing.

Suggestions?

Thank you

···

--
Alessandro Iob <alessandro.iob@dlevel.com>
D-Level srl, via Cavour 78, 33050 Rivignano UD ITALY
Tel: +39 0432 773785, Fax: +39 0432 774217
WWW: http://www.dlevel.com , E-Mail: info@dlevel.com

The test:

in wxPython demo/wxTreeCtrl.py add the following line of code at the end
of TestTreeCtrlPanel __init__ function:

self.tree.SortChildren (self.root)

from now on whenever the wxTreeCtrl demo is executed, some memory is
allocated and never released. Switch multiple times between this and
other demos and watch memory growing. I reproduced this problem on
version 2.3.2.1 and 2.3.3p4 of wxPython either on Linux/GTK and on
Win2K, with the demo and with an application I'm developing.

This is probably an artifact of the demo framework when you switch demos,
and not of SortChildren. The demo already does a SortChildren if you double
click on a tree item and you can see that the process' memory does not grow
if you double click items multiple times.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

In my application using SortChildren gets the result I described: a
chunck of memory (of size dependable on number of tree items) is
permanently lost whenever the tree is created/destroyed.
Memory is lost only when the tree has/had items in it.
Seems that the tree sort functions does not deallocate memory used for
sorting.
Everything works when no item is inserted/deleted.

···

On Tue, 2002-07-02 at 19:46, Robin Dunn wrote:

> The test:
>
> in wxPython demo/wxTreeCtrl.py add the following line of code at the end
> of TestTreeCtrlPanel __init__ function:
>
> self.tree.SortChildren (self.root)
>
> from now on whenever the wxTreeCtrl demo is executed, some memory is
> allocated and never released. Switch multiple times between this and
> other demos and watch memory growing. I reproduced this problem on
> version 2.3.2.1 and 2.3.3p4 of wxPython either on Linux/GTK and on
> Win2K, with the demo and with an application I'm developing.

This is probably an artifact of the demo framework when you switch demos,
and not of SortChildren. The demo already does a SortChildren if you double
click on a tree item and you can see that the process' memory does not grow
if you double click items multiple times.

--
Alessandro Iob <alessandro.iob@dlevel.com>
D-Level srl, via Cavour 78, 33050 Rivignano UD ITALY
Tel: +39 0432 773785, Fax: +39 0432 774217
WWW: http://www.dlevel.com , E-Mail: info@dlevel.com

This is probably an artifact of the demo framework when you switch
demos, and not of SortChildren. The demo already does a
SortChildren >if you double click on a tree item and you can see
that the process' >memory does not grow if you double click items
multiple times.

In my application using SortChildren gets the result I described: a
chunck of memory (of size dependable on number of tree items) is
permanently lost whenever the tree is created/destroyed. Memory is
lost only when the tree has/had items in it. Seems that the tree
sort functions does not deallocate memory used for sorting.
Everything works when no item is inserted/deleted.

What about if you do or don't call SortChildren? Please reduce it to a
small sample and send it.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

hai guys thanx for previous answer for my problem it
was great!!! now I have new problem. I tried to
retrieve data from database into columns in wxListCtrl
& I used code in the demo wxListCtrl. But I bump into
a problem when settin values to the columns & this is
my code:

        self.list = wxListCtrl(self, tID,
style=wxLC_REPORT|wxSUNKEN_BORDER)#|wxLC_VRULES|wxLC_HRULES)

        if 0:
            # for normal simple columns, you can add
them like this:
            self.list.InsertColumn(0, "ID")
            self.list.InsertColumn(1, "Nama",
wxLIST_FORMAT_CENTER)
        else:
            # but since we want images on the column
header we have to do it the hard way:
            info = wxListItem()
            info.m_mask = wxLIST_MASK_TEXT |
wxLIST_MASK_FORMAT
            info.m_format = 0
            info.m_text = "ID"
            self.list.InsertColumnInfo(0, info)

            info.m_format = wxLIST_FORMAT_CENTER
            info.m_text = "Nama"
            self.list.InsertColumnInfo(1, info)
            
            total = len(self.Kueri())
            nilai = self.Kueri()
            
        for jumlah_data in range(total):
            self.list.SetStringItem(jumlah_data, 0,
nilai[jumlah_data][0])
            self.list.SetStringItem(jumlah_data, 1,
nilai[jumlah_data][1])

    def Kueri(self):
        s = odbc.odbc('mysql/danukusmana/kam3pung')
        cur = s.cursor()
        cur.execute('select * from user')
        rec = cur.fetchall()
        return rec

please help me with this guys!!!

thanx

M. Danu F.

···

__________________________________________________
Do You Yahoo!?
Yahoo! Tech - Get in touch with the latest in technology.
http://sg.tech.yahoo.com