Opened 16 years ago

Closed 16 years ago

Last modified 12 months ago

#1563 closed defect

GUI: memory leaks in 0.6.0 on windows

Reported by: SF/matt_hargett Owned by: fingolfin
Priority: normal Component: GUI
Keywords: Cc:
Game:

Description

Just did a run through BoundsChecker and detected these
leaks. Looking at the code, they sure look like leaks
to me as well. They appear to be related
WindowsFilesystemNode::addFile(), which was called many
times as I was browsing the filesystem and adding games
via the launcher UI.

String::ensureCapacity (str.cpp, L209)
char *newStr = (char *)calloc(1, newCapacity+1);

WindowsFilesystemNode::clone (windows-fs.cpp, line 54)
virtual FilesystemNode *clone() const { return new
WindowsFilesystemNode(this); }

WindowsFilesystemNode::listDir (windows-fs.cpp, line 143)
FSList *myList = new FSList();

All of these are not one-time leaks, and happen many
many times. I can give more details if necessary, but
it looks pretty obvious to me.

Ticket imported from: #922928. Ticket imported from: bugs/1563.

Change History (5)

comment:1 by fingolfin, 16 years ago

I don't think the String class is leaking; however, the FSNodes have
strings as members, so if they leak, then of course also string objects
get leaked.

The only leak I found was in addGame(). Try modifying gui/launcher.cpp,
LauncherDialog::addGame(), insert line 411:

delete files;
files = 0;

Does that help?

comment:2 by fingolfin, 16 years ago

Owner: set to fingolfin
Summary: memory leaks in 0.6.0 on windowsGUI: memory leaks in 0.6.0 on windows

comment:3 by fingolfin, 16 years ago

Awaiting reply by bug submitter.

comment:4 by fingolfin, 16 years ago

Status: newclosed

comment:5 by digitall, 12 months ago

Component: GUI
Note: See TracTickets for help on using tickets.