mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-04-21 12:27:27 +03:00
Fixed a good number of memory leaks.
The objects created with "new" were destroyed with "free()", instead of "delete"; as a result, the destructors were never called.
This commit is contained in:
@@ -116,7 +116,7 @@ void Menu::loadIcons() {
|
||||
void Menu::freeLinks() {
|
||||
for (vector<linklist>::iterator section = links.begin(); section<links.end(); section++)
|
||||
for (linklist::iterator link = section->begin(); link<section->end(); link++)
|
||||
free(*link);
|
||||
delete *link;
|
||||
}
|
||||
|
||||
linklist *Menu::sectionLinks(int i) {
|
||||
@@ -454,7 +454,7 @@ void Menu::readLinks() {
|
||||
if (link->targetExists())
|
||||
links[i].push_back( link );
|
||||
else
|
||||
free(link);
|
||||
delete link;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user