I've developed a small application on Windows 2K using Activestate Python
2.1 and wxPython 2.3.1. It involves a single frame with a tab notebook
containing two tabs - a grid and list control.
I've managed to get everything working, but I noticed that I'm getting
memory leak erros when I execute the program using Scintilla. I've tracked
it down, and it occurrs when I call getText on an item selected from a list
control.
For example -
def getColumnText(self, index, col):
"Used by OnItemSelected to pull the actual text values in the list"
item = self.noteTabs.listCtrl.GetItem(index, col)
return item.GetText()
def OnItemSelected(self, event):
"When items in the list are selected, copy them to the clipboard"
self.currentItem = event.m_itemIndex
self.name = self.noteTabs.listCtrl.GetItemText(self.currentItem)
self.build = self.getColumnText(self.currentItem,1)
It seems to work just fine, but if I run the program, load some data into
my list, then click on a list item, I get the following error (when I exit)
for each item I select -
pythonw -u gui-oop-parse-logs.py
13:26:19: There were memory leaks.
13:26:19: ----- Memory dump -----
13:26:19: wxListItem at $1556D30, size 52
13:26:19: wxListItem at $163E320, size 52
13:26:19: wxListItem at $15B4C50, size 52
13:26:19: wxListItem at $157AC60, size 52
13:26:19: wxListItem at $14BAA90, size 52
13:26:19: wxListItem at $218AC30, size 52
13:26:19:
13:26:19:
13:26:19: ----- Memory statistics -----
13:26:19: 6 objects of class wxListItem, total size 312
13:26:19:
13:26:19: Number of object items: 6
13:26:19: Number of non-object items: 0
13:26:19: Total allocated size: 312
13:26:19:
13:26:19:
If I don't click on an item, it doesn't give me an error. If I comment out
the getText method, I don't get an error either.
Anyone have any ideas what I may be doing wrong?
Thanks,
Chris